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

Update scipy requirement from <=1.14.1,>=1.7.0 to >=1.7.0,<=1.15.0 #1506

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

dependabot[bot]
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Jan 6, 2025

Updates the requirements on scipy to permit the latest version.

Release notes

Sourced from scipy's releases.

SciPy 1.15.0 Release Notes

SciPy 1.15.0 is the culmination of 6 months of hard work. It contains many new features, numerous bug-fixes, improved test coverage and better documentation. There have been a number of deprecations and API changes in this release, which are documented below. All users are encouraged to upgrade to this release, as there are a large number of bug-fixes and optimizations. Before upgrading, we recommend that users check that their own code does not use deprecated SciPy functionality (to do so, run your code with python -Wd and check for DeprecationWarning s). Our development attention will now shift to bug-fix releases on the 1.15.x branch, and on adding new features on the main branch.

This release requires Python 3.10-3.13 and NumPy 1.23.5 or greater.

Highlights of this release

  • Sparse arrays are now fully functional for 1-D and 2-D arrays. We recommend that all new code use sparse arrays instead of sparse matrices and that developers start to migrate their existing code from sparse matrix to sparse array: migration_to_sparray. Both sparse.linalg and sparse.csgraph work with either sparse matrix or sparse array and work internally with sparse array.

  • Sparse arrays now provide basic support for n-D arrays in the COO format including add, subtract, reshape, transpose, matmul, dot, tensordot and others. More functionality is coming in future releases.

  • Preliminary support for free-threaded Python 3.13.

  • New probability distribution features in scipy.stats can be used to improve the speed and accuracy of existing continuous distributions and perform new probability calculations.

  • Several new features support vectorized calculations with Python Array API Standard compatible input (see "Array API Standard Support" below):

    • scipy.differentiate is a new top-level submodule for accurate estimation of derivatives of black box functions.
    • scipy.optimize.elementwise contains new functions for root-finding and minimization of univariate functions.
    • scipy.integrate offers new functions cubature, tanhsinh, and nsum for multivariate integration, univariate integration, and univariate series summation, respectively.
  • scipy.interpolate.AAA adds the AAA algorithm for barycentric rational approximation of real or complex functions.

  • scipy.special adds new functions offering improved Legendre function implementations with a more consistent interface.

... (truncated)

Commits
  • 6e246d0 REL: 1.15.0 "final" rel commit [wheel build]
  • ed7c850 Merge pull request #22233 from tylerjereddy/treddy_backports_1.15.0_final
  • 2e2f2cd MAINT: PR 22233 wheel build [wheel build]
  • f05c622 DOC: Update 1.15.0 relnotes
  • 7348d92 Update scipy/differentiate/_differentiate.py
  • 56b1f7e DOC: differentiate.jacobian: correct/improve documentation about callable int...
  • 30077e7 DEP: linalg.solve_toeplitz/matmul_toeplitz: warn on n-D c, r (#22193)
  • 256c1a2 Merge pull request #22181 from tylerjereddy/treddy_prep_scipy_1.15.0rc3
  • f046276 REL: set 1.15.0rc3 unreleased
  • a3d40a8 REL: 1.15.0rc2 rel commit [wheel build]
  • Additional commits viewable in compare view

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Updates the requirements on [scipy](https://github.com/scipy/scipy) to permit the latest version.
- [Release notes](https://github.com/scipy/scipy/releases)
- [Commits](scipy/scipy@v1.7.0...v1.15.0)

---
updated-dependencies:
- dependency-name: scipy
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
@dependabot dependabot bot added dependencies Issue related to libraries we depend on and how we interface with them python Pull requests that update Python code labels Jan 6, 2025
Copy link
Contributor

github-actions bot commented Jan 6, 2025

|             benchmark_name             |         dt(%)          |         dt(s)          |        t_new(s)        |        t_old(s)        | 
| -------------------------------------- | ---------------------- | ---------------------- | ---------------------- | ---------------------- |
 test_build_transform_fft_lowres         |     +5.77 +/- 6.73     | +3.04e-02 +/- 3.54e-02 |  5.56e-01 +/- 3.1e-02  |  5.26e-01 +/- 1.6e-02  |
 test_equilibrium_init_medres            |     +5.01 +/- 5.44     | +2.15e-01 +/- 2.34e-01 |  4.51e+00 +/- 1.2e-01  |  4.29e+00 +/- 2.0e-01  |
 test_equilibrium_init_highres           |     +7.66 +/- 3.59     | +4.19e-01 +/- 1.96e-01 |  5.89e+00 +/- 1.7e-01  |  5.47e+00 +/- 9.9e-02  |
 test_objective_compile_dshape_current   |     +2.90 +/- 3.33     | +1.15e-01 +/- 1.32e-01 |  4.09e+00 +/- 1.2e-01  |  3.98e+00 +/- 4.6e-02  |
 test_objective_compute_dshape_current   |     +0.09 +/- 1.21     | +4.58e-06 +/- 6.27e-05 |  5.20e-03 +/- 4.4e-05  |  5.20e-03 +/- 4.5e-05  |
 test_objective_jac_dshape_current       |     -0.92 +/- 5.54     | -4.11e-04 +/- 2.48e-03 |  4.44e-02 +/- 8.1e-04  |  4.48e-02 +/- 2.3e-03  |
 test_perturb_2                          |     +4.32 +/- 1.77     | +8.55e-01 +/- 3.50e-01 |  2.06e+01 +/- 1.7e-01  |  1.98e+01 +/- 3.1e-01  |
 test_proximal_freeb_jac                 |     +1.79 +/- 1.80     | +1.34e-01 +/- 1.34e-01 |  7.60e+00 +/- 1.2e-01  |  7.47e+00 +/- 6.5e-02  |
 test_solve_fixed_iter                   |     +0.37 +/- 2.29     | +1.24e-01 +/- 7.71e-01 |  3.37e+01 +/- 4.9e-01  |  3.36e+01 +/- 5.9e-01  |
 test_LinearConstraintProjection_build   |     -4.47 +/- 3.94     | -4.96e-01 +/- 4.37e-01 |  1.06e+01 +/- 3.8e-01  |  1.11e+01 +/- 2.1e-01  |
 test_build_transform_fft_midres         |     +1.91 +/- 3.21     | +1.21e-02 +/- 2.04e-02 |  6.47e-01 +/- 2.0e-02  |  6.35e-01 +/- 5.3e-03  |
 test_build_transform_fft_highres        |     -1.22 +/- 2.48     | -1.23e-02 +/- 2.50e-02 |  9.97e-01 +/- 1.7e-02  |  1.01e+00 +/- 1.8e-02  |
 test_equilibrium_init_lowres            |     -1.94 +/- 7.46     | -8.13e-02 +/- 3.12e-01 |  4.10e+00 +/- 2.4e-01  |  4.19e+00 +/- 2.0e-01  |
 test_objective_compile_atf              |     -0.89 +/- 1.77     | -7.38e-02 +/- 1.46e-01 |  8.19e+00 +/- 1.2e-01  |  8.26e+00 +/- 8.5e-02  |
 test_objective_compute_atf              |     -1.52 +/- 4.86     | -2.47e-04 +/- 7.91e-04 |  1.60e-02 +/- 3.9e-04  |  1.63e-02 +/- 6.9e-04  |
 test_objective_jac_atf                  |     -0.20 +/- 1.69     | -3.97e-03 +/- 3.33e-02 |  1.96e+00 +/- 2.4e-02  |  1.97e+00 +/- 2.3e-02  |
 test_perturb_1                          |     -0.21 +/- 2.03     | -3.22e-02 +/- 3.14e-01 |  1.54e+01 +/- 2.3e-01  |  1.55e+01 +/- 2.1e-01  |
 test_proximal_jac_atf                   |     +0.54 +/- 0.86     | +4.44e-02 +/- 7.11e-02 |  8.32e+00 +/- 4.9e-02  |  8.27e+00 +/- 5.1e-02  |
 test_proximal_freeb_compute             |     +0.16 +/- 0.72     | +3.14e-04 +/- 1.46e-03 |  2.02e-01 +/- 9.4e-04  |  2.02e-01 +/- 1.1e-03  |
 test_solve_fixed_iter_compiled          |     +1.09 +/- 1.95     | +2.28e-01 +/- 4.08e-01 |  2.11e+01 +/- 3.1e-01  |  2.09e+01 +/- 2.7e-01  |

@dpanici
Copy link
Collaborator

dpanici commented Jan 7, 2025

test compute everything fails with differences ranging from 1e-9 to 1e-10, and scipy 1.15.0 seems to be the main package change here. We could reduce the rtol even further but I dont understand where we use scipy that is affecting the down-wind computations of J, F etc. This is using eq.get_examples("W7-X") for the equilibrium so it is not like a new eq solve was performed.

@dpanici
Copy link
Collaborator

dpanici commented Jan 8, 2025

check mu0

@dpanici
Copy link
Collaborator

dpanici commented Jan 9, 2025

mu_0 indeed changed from 1.256 637 062 12 e-6 to 1.256 637 061 27 e-6 which is a change of ~1e-15 which means when multiplied by the large values like MA of current can yield absolute changes on the order of ~1e-9 which is what we are seeing.

Question is, this would mean that this test fails just based off of which scipy version is being used... I don't really like that. we also sometimes in the code use 4pi e-7 instead of mu_0 I am pretty sure, which is sort of inconsistent if we use mu_0 elsewhere sometimes

@f0uriest
Copy link
Member

f0uriest commented Jan 9, 2025

mu_0 indeed changed from 1.256 637 062 12 e-6 to 1.256 637 061 27 e-6 which is a change of ~1e-15 which means when multiplied by the large values like MA of current can yield absolute changes on the order of ~1e-9 which is what we are seeing.

Question is, this would mean that this test fails just based off of which scipy version is being used... I don't really like that. we also sometimes in the code use 4pi e-7 instead of mu_0 I am pretty sure, which is sort of inconsistent if we use mu_0 elsewhere sometimes

I think we should probably just be loosening tolerances so that it passes if its that sensitive. I thought we did this previously when dealing with zero current cases?

Also we probably shouldn't be using 4pi*1e-7, since they redefined the SI base units in 2019 so mu0 is now an experimentally measured qty not a fixed constant.

Copy link
Contributor Author

dependabot bot commented on behalf of github Jan 13, 2025

A newer version of scipy exists, but since this PR has been edited by someone other than Dependabot I haven't updated it. You'll get a PR for the updated version as normal once this PR is merged.

@dpanici
Copy link
Collaborator

dpanici commented Jan 15, 2025

@dpanici update test tolerances

@dpanici dpanici added the skip_changelog No need to update changelog on this PR label Jan 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Issue related to libraries we depend on and how we interface with them python Pull requests that update Python code skip_changelog No need to update changelog on this PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants