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

Numpy2 #58

Closed
wants to merge 101 commits into from
Closed

Numpy2 #58

wants to merge 101 commits into from

Conversation

andyfaff
Copy link
Owner

@andyfaff andyfaff commented Sep 9, 2023

No description provided.

mdhaber and others added 30 commits July 21, 2023 14:14
Closes scipy#17864.

Add inverse Hessian estimate parameter `hk_init`
in `_minimize_bfgs`.
`hk_init` is checked to be positive definite and
initializes `Hk` if not `None` else `Hk` is set to identity.
Add unit-test to check non positive definite `hk_init`
are not allowed.
Removing `rtol` and `atol` from symmetric check in `_check_positive_definite`.
Adress comment on testing

Co-authored-by: Daniel Schmitz <[email protected]>
remove double empty line bw `_check` functions

Co-authored-by: Andrew Nelson <[email protected]>
Addressing line length and documentation comments.
scottshambaugh and others added 29 commits September 6, 2023 07:10
…well as minimum-distance rotations for single vectors (scipy#17542)

* ENH: Extend Rotation.align_vectors() to allow single-vector alignment and infinite weights

* Docstring and comment tweaks

* Error message fix

* Minimize diff

* Code review updates

---------

Co-authored-by: Scott Shambaugh <[email protected]>
…9156)

* BUG: Support sparse arrays in scipy.sparse.csgraph.laplacian

* TST: Added unit test for laplacian
DOC: stats.Covariance: fixed typo
… and root (scipy#19128)

ENH: optimize: add method attribute to result object from root_scalar and root
TST: test tolerance bumps to fix reported failures
[skip cirrus] [skip circle]
BUG: accept `np`-coercible array-likes with array API flag set
…ipy#19200)

This was failing on macOS x86-64 in CI with:
```
 E   Arrays are not almost equal to 6 decimals
E
E   Mismatched elements: 1 / 25 (4%)
E   Max absolute difference: 1.52291797e-06
E   Max relative difference: 8.81522156e-07
E    x: array([[ 2.108927e+00, -1.943767e+00,  7.026353e-02, -4.717525e-02,
E            5.251554e-02],
E          [-1.943767e+00,  2.048149e+00, -6.160049e-02,  4.626880e-02,...
E    y: array([[ 2.108927e+00, -1.943769e+00,  7.026355e-02, -4.717527e-02,
E            5.251558e-02],
E          [-1.943769e+00,  2.048151e+00, -6.160052e-02,  4.626883e-02,...
```

So it's a very small atol violation (1.52e-6, where decimal=6 implies
1.5e-6). Rather than bump to `decimal=5`, I decided to change the test
to `assert_allclose` so the bump could be smaller.

[skip ci]
All in title, this create parsing errors/incorrect docs.

[skip ci]
…ves (scipy#19198)

* DOC: optimize.minimize_scalar: note limitations and suggest alternatives

[skip actions] [skip cirrus]

* DOC: fix incorrect reference

[skip actions] [skip cirrus]

* Update scipy/optimize/_minimize.py

[skip ci]

---------

Co-authored-by: Jake Bowhay <[email protected]>
without the leading prompt this is interpreted as the result the
previous line should produce.
…9184)

* fix test with large memory footprint, `test_concatenate_int32_overflow`
* Fixes scipy#19190

* the module-level skipping described in the above issue
was causing spurious skips in some cases as described there,
so move the tests in that module to a class guarded with
a `skipif` mark, which seems to be the preferred approach
anyway according to:
https://docs.pytest.org/en/7.1.x/reference/reference.html?highlight=pytest%20skip#pytest.skip

* on this branch I seem to get the expected behavior with
i.e.,
- `python dev.py test -v -- -k "test_concatenate_int32_overflow" -rsx`
  - `59382 deselected`
- `python dev.py test -m full -v -- -k "test_concatenate_int32_overflow" -rsx`
  - `1 passed, 59381 deselected`
- `python dev.py test -v -t scipy/sparse/tests/test_construct.py::TestConstructUtils::test_concatenate_int32_overflow -- -rsx`
  - `1 deselected`
- `SCIPY_ARRAY_API=1 python dev.py test -v -t "scipy/_lib/tests/test_array_api.py" -b cupy -- -rsx`
  - just the two failures expected from scipygh-19194
- `python dev.py test -v -t "scipy/_lib/tests/test_array_api.py" -b cupy -- -rsx`
  - same (the backend setting implies the env var)
- `python dev.py test -v -t "scipy/_lib/tests/test_array_api.py" -- -rsx`
  - `6 skipped`
- `python dev.py test -j 32 -b all`
  - `3 failed, 44291 passed, 2546 skipped, 149 xfailed, 12 xpassed`
    (failures noted above + PyTorch issue from scipygh-18930)
- `SCIPY_DEVICE=cuda python dev.py test -j 32 -b all`
  - `3 failed, 44198 passed, 2639 skipped, 149 xfailed, 12 xpassed`
    (failures noted above + PyTorch issue from scipygh-18930)

* could there be a `pytest` bug here somewhere? Yeah, probably. But
  given that following their docs suggestion to avoid the global skip
  scope seems to solve the problem, I'm inclined not to spend much time
  providing a small reproducer upstream and debating with them. It is
  probably related to the `-k` option collecting every single test node
  vs. the hand-tuned selection of the single node on the command line.

[skip cirrus]
scipy#19146)

* Resolve scipy#18881: Enhance lobpcg documentation with updated examples

- Added examples utilizing `aslinearoperator` and `LinearOperator`

* Fixed issues mentioned in the reviewed comments.

* Removed redundant imports in lobpcg.py

* Update scipy/sparse/linalg/_eigen/lobpcg/lobpcg.py

Co-authored-by: Jake Bowhay <[email protected]>

* Update scipy/sparse/linalg/_eigen/lobpcg/lobpcg.py

Co-authored-by: Jake Bowhay <[email protected]>

* Update scipy/sparse/linalg/_eigen/lobpcg/lobpcg.py

Co-authored-by: Jake Bowhay <[email protected]>

* Update scipy/sparse/linalg/_eigen/lobpcg/lobpcg.py

Co-authored-by: Jake Bowhay <[email protected]>

* Using spdiags instead of diags in lobpcg.py in examples

* Removed unnecessary variables

* Update scipy/sparse/linalg/_eigen/lobpcg/lobpcg.py

Co-authored-by: Jake Bowhay <[email protected]>

* Update scipy/sparse/linalg/_eigen/lobpcg/lobpcg.py

Co-authored-by: Jake Bowhay <[email protected]>

* editorial changes lobpcg.py

[skip actions] [skip cirrus]

* typo fix lobpcg.py

[skip actions] [skip cirrus]

* LinearOperator requires dtype specified lobpcg.py

I think that it is a bug in LinearOperator, filed
[skip actions] [skip cirrus]

* print removed lobpcg.py

[skip actions] [skip cirrus]

---------

Co-authored-by: Jake Bowhay <[email protected]>
Co-authored-by: Andrew Knyazev <[email protected]>
[skip cirrus] [skip circle]

Co-authored-by: Tyler Reddy <[email protected]>
BUG/TST: fix `test_array_api` for `cupy`
BLD: update minimum versions of meson-python and pythran
@andyfaff andyfaff closed this Sep 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.