Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MAINT: 1.9.1 backports #16901

Merged

Conversation

rgommers and others added 11 commits August 25, 2022 15:36
…uild files (scipy#16749)

* BLD: remove a warning suppression flag for HiGHS extension

This is no longer necessary, the PR linked in the removed comment
is included in our `highs` git submodule now.

* BLD: remove an outdated FIXME from the scipy/integrate/meson.build

This was fixed I believe (there are no skipped or xfailed tests either),
and the comment isn't very informative.

* BLD: remove another FIXME in `cython_optimize/meson.build`, it's not broken

The code can be simplified once the upstream feature is added, but
that's not a FIXME.

* BLD: remove comments about c++14/c++11 support

We can rely on C++14 unconditionally since 2021, see
http://scipy.github.io/devdocs/dev/toolchain.html#c-language-standards

* BLD: update info on including all license files as separate files

* BLD: install missing `scipy/*.pxd` files

No tests were failing, so something is fairly badly wrong in
the test suite.

Also add `optimize.cython_optimize` to the list of submodules that are
public API.

* BLD: remove FIXME about version string generation

This was fixed when adding `--git-dir` to the git invocation,
that made the result independent from the current directory
when invoking the build.

* BLD: remove TODO about `-fallow-argument-mismatch`

This flag is added implicitly via 'fortran_std=legacy' in the
top-level `meson.build`. Warnings that show up are silenced
in multiple modules, so there's no need for a separate TODO here.

* BLD: remove TODO for UNU.RAN version string

This isn't a very useful today, given that we don't use this
version string. The corresponding `setup.py` file also does the
same and doesn't have a TODO.

* BLD: update FIXME to a TODO in `linalg/meson.build`
This is a fallback detection path, in case pkg-config fails to find `openblas`.
CMake uses the camelcase version of the name.

If CMake is installed and it finds OpenBLAS, the result looks like:
```
Determining dependency 'OpenBLAS' with pkg-config executable '/home/rgommers/anaconda3/envs/scipy-dev/bin/pkg-config'
env[PKG_CONFIG_PATH]:
Called `/home/rgommers/anaconda3/envs/scipy-dev/bin/pkg-config --modversion OpenBLAS` -> 1

CMake binary for 1 is cached.

Determining dependency 'OpenBLAS' with CMake executable '/home/rgommers/anaconda3/envs/scipy-dev/bin/cmake'
Try CMake generator: auto
Calling CMake (['/home/rgommers/anaconda3/envs/scipy-dev/bin/cmake']) in /home/rgommers/code/scipy/build/meson-private/cmake_OpenBLAS with:
  - "-DNAME=OpenBLAS"
  - "-DARCHS=libpyldb-util.cpython-310-x86-64-linux-gnu.so;libpyldb-util.cpython-310-x86-64-linux-gnu.so.2;libpyldb-util.cpython-310-x86-64-linux-gnu.so.2.5.0;libpytalloc-util.cpython-310-x86-64-linux-gnu.so;libpytalloc-util.cpython-310-x86-64-linux-gnu.so.2;libpytalloc-util.cpython-310-x86-64-linux-gnu.so.2.3.3;libsamba-policy.cpython-310-x86-64-linux-gnu.so;libsamba-policy.cpython-310-x86-64-linux-gnu.so.0;libsamba-policy.cpython-310-x86-64-linux-gnu.so.0.0.1"
  - "-DVERSION="
  - "-DCOMPS="
  - "--trace-expand"
  - "--trace-format=json-v1"
  - "--no-warn-unused-cli"
  - "--trace-redirect=cmake_trace.txt"
  - "-DCMAKE_TOOLCHAIN_FILE=/home/rgommers/code/scipy/build/meson-private/cmake_OpenBLAS/CMakeMesonToolchainFile.cmake"
  - "."
  - "-DCMAKE_PREFIX_PATH=/home/rgommers/anaconda3/envs/scipy-dev;/home/rgommers/anaconda3/envs/scipy-dev/x86_64-conda-linux-gnu/sysroot/usr"
using old-style CMake variables for dependency OpenBLAS
Include Dirs:         ['/home/rgommers/anaconda3/envs/scipy-dev/include']
Compiler Definitions: []
Libraries:            ['/home/rgommers/anaconda3/envs/scipy-dev/lib/libopenblas.so']
Run-time dependency openblas found: YES 0.3.20
```

This follows up on comments in scipygh-16308
Instead of string concatenation, use Meson's path operator, which was
designed based on the same concept as pathlib.Path and uses the /
operator overload (but effectively using .as_posix() for consistency).
This guarantees consistent handling, and also avoids e.g. introspection
files containing duplicated path separators such as
`.../site-packages//scipy/...`

This is also required in order for Meson to internally track when an
install_dir string comes from py3.get_install_dir() after path-based
joining semantics, which is needed for improvements to the mesonpy build
backend.
This mirrors the change in scipy/oldest-supported-numpy#61
NumPy 1.23.3 is the first numpy version with 3.11 wheels on PyPI.
The Schur decomposition is not unique, so testing the result
of linalg.schur against hard-coded matrices is not reliable.
The updated tests check that the desired properties of the
result are satisfied, and that the order of the diagonal
elements of the triangular matrix agrees with the given
'sort' parameter.

Closes scipygh-14517
@tylerjereddy tylerjereddy added the maintenance Items related to regular maintenance tasks label Aug 25, 2022
@tylerjereddy tylerjereddy added this to the 1.9.1 milestone Aug 25, 2022
Copy link
Contributor Author

@tylerjereddy tylerjereddy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The other CI failure is:

/opt/hostedtoolcache/Python/3.8.13/x64/lib/python3.8/site-packages/scipy/sparse/linalg/_eigen/lobpcg/tests/test_lobpcg.py:355: in test_tolerance_float32
    assert_allclose(eigvals, -np.arange(1, 1 + m), atol=1.5e-5)
E   AssertionError: 
E   Not equal to tolerance rtol=1e-07, atol=1.5e-05
E   
E   Mismatched elements: 1 / 3 (33.3%)
E   Max absolute difference: 1.6450882e-05
E   Max relative difference: 5.48362732e-06
E    x: array([-1.      , -2.000003, -3.000016], dtype=float32)
E    y: array([-1, -2, -3])
        A          = <50x50 sparse matrix of type '<class 'numpy.float32'>'
	with 50 stored elements (1 diagonals) in DIAgonal format>
        X          = array([[ 1.7640524 ,  0.4001572 ,  0.978738  ],
       [ 2.2408931 ,  1.867558  , -0.9772779 ],
       [ 0.95008844, -...03146],
       [ 2.3831449 ,  0.94447947, -0.91282225],
       [ 1.1170163 , -1.3159074 , -0.4615846 ]], dtype=float32)
        _          = array([[ 1.00000000e+00, -4.98104975e-13, -1.17866172e-07],
       [-6.63076853e-13, -1.00000000e+00, -2.94708485e-07]...091e-09,  4.23395043e-08,  3.24512008e-08],
       [ 1.32321158e-08, -1.75330488e-08, -2.44689122e-08]], dtype=float32)
        eigvals    = array([-1.       , -2.000003 , -3.0000165], dtype=float32)
        m          = 3
        n          = 50
        rnd        = RandomState(MT19937) at 0x7FE549992440
        vals       = array([ -1,  -2,  -3,  -4,  -5,  -6,  -7,  -8,  -9, -10, -11, -12, -13,
       -14, -15, -16, -17, -18, -19, -20, -21,..., -29, -30, -31, -32, -33, -34, -35, -36, -37, -38, -39,
       -40, -41, -42, -43, -44, -45, -46, -47, -48, -49, -50])

doc/API.rst.txt Outdated Show resolved Hide resolved
@andyfaff
Copy link
Contributor

@tylerjereddy @rgommers I think we also need 49cac09 to be cherry picked.

@WarrenWeckesser
Copy link
Member

For the test_tolerance_float32 failure, it looks like #16755 should be backported.

rgommers and others added 4 commits August 26, 2022 10:50
…nce_float32' (scipy#16755)

This test has been failing occasionally in CI, with errors slightly greater than
the requested tolerances.

(cherry picked from commit f71e7fa)
I think this will fix the issue with commit count being zero reported
in scipygh-16702.

(cherry picked from commit 97ee16d)
Copy link
Member

@rgommers rgommers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @tylerjereddy & all. I included all the suggested fixes and added one more backported commit (the version numbering robustness one).

This all LGTM provided it comes back green. I'll open a separate PR for updated dependency ranges.

@tylerjereddy tylerjereddy merged commit 987c698 into scipy:maintenance/1.9.x Aug 26, 2022
@tylerjereddy tylerjereddy deleted the treddy_191_backports branch August 26, 2022 15:50
@tylerjereddy
Copy link
Contributor Author

CI was green and I've manually cleared out the related backport candidate labels as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance Items related to regular maintenance tasks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants