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

Support numpy 2.0 #1319

Merged
merged 22 commits into from
Nov 15, 2024
Merged

Support numpy 2.0 #1319

merged 22 commits into from
Nov 15, 2024

Conversation

YigitElma
Copy link
Collaborator

No description provided.

Copy link

codecov bot commented Oct 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.51%. Comparing base (3150bc5) to head (d45f5d3).
Report is 4 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1319   +/-   ##
=======================================
  Coverage   95.51%   95.51%           
=======================================
  Files          96       96           
  Lines       24047    24047           
=======================================
  Hits        22969    22969           
  Misses       1078     1078           
Files with missing lines Coverage Δ
desc/basis.py 98.18% <100.00%> (ø)
desc/magnetic_fields/_core.py 96.61% <100.00%> (ø)

... and 2 files with indirect coverage changes

Copy link
Contributor

github-actions bot commented Oct 24, 2024

|             benchmark_name             |         dt(%)          |         dt(s)          |        t_new(s)        |        t_old(s)        | 
| -------------------------------------- | ---------------------- | ---------------------- | ---------------------- | ---------------------- |
 test_build_transform_fft_midres         |     -2.04 +/- 6.38     | -1.25e-02 +/- 3.93e-02 |  6.03e-01 +/- 2.4e-02  |  6.16e-01 +/- 3.1e-02  |
 test_build_transform_fft_highres        |     +0.15 +/- 4.22     | +1.40e-03 +/- 4.06e-02 |  9.64e-01 +/- 2.2e-02  |  9.62e-01 +/- 3.4e-02  |
 test_equilibrium_init_lowres            |     -1.53 +/- 4.96     | -6.01e-02 +/- 1.95e-01 |  3.87e+00 +/- 8.8e-02  |  3.93e+00 +/- 1.7e-01  |
 test_objective_compile_atf              |     -0.69 +/- 4.52     | -5.45e-02 +/- 3.57e-01 |  7.83e+00 +/- 2.7e-01  |  7.89e+00 +/- 2.3e-01  |
 test_objective_compute_atf              |     -3.63 +/- 4.20     | -3.92e-04 +/- 4.53e-04 |  1.04e-02 +/- 1.3e-04  |  1.08e-02 +/- 4.3e-04  |
 test_objective_jac_atf                  |     -0.82 +/- 3.79     | -1.57e-02 +/- 7.28e-02 |  1.91e+00 +/- 5.2e-02  |  1.92e+00 +/- 5.1e-02  |
 test_perturb_1                          |     -1.06 +/- 4.92     | -1.36e-01 +/- 6.34e-01 |  1.27e+01 +/- 3.1e-01  |  1.29e+01 +/- 5.5e-01  |
 test_proximal_jac_atf                   |     -0.06 +/- 0.88     | -4.84e-03 +/- 7.20e-02 |  8.20e+00 +/- 5.7e-02  |  8.20e+00 +/- 4.4e-02  |
 test_proximal_freeb_compute             |     -1.87 +/- 1.45     | -3.49e-03 +/- 2.70e-03 |  1.83e-01 +/- 1.3e-03  |  1.87e-01 +/- 2.4e-03  |
 test_build_transform_fft_lowres         |     -0.28 +/- 9.27     | -1.46e-03 +/- 4.92e-02 |  5.30e-01 +/- 4.3e-02  |  5.31e-01 +/- 2.5e-02  |
 test_equilibrium_init_medres            |     +0.44 +/- 1.40     | +1.82e-02 +/- 5.83e-02 |  4.17e+00 +/- 4.4e-02  |  4.15e+00 +/- 3.8e-02  |
 test_equilibrium_init_highres           |     -0.14 +/- 1.67     | -7.69e-03 +/- 9.12e-02 |  5.44e+00 +/- 7.1e-02  |  5.45e+00 +/- 5.7e-02  |
 test_objective_compile_dshape_current   |     +0.79 +/- 1.84     | +3.07e-02 +/- 7.14e-02 |  3.91e+00 +/- 4.7e-02  |  3.88e+00 +/- 5.4e-02  |
 test_objective_compute_dshape_current   |     +5.20 +/- 1.86     | +1.89e-04 +/- 6.78e-05 |  3.83e-03 +/- 4.7e-05  |  3.64e-03 +/- 4.9e-05  |
 test_objective_jac_dshape_current       |     -0.73 +/- 7.48     | -3.05e-04 +/- 3.13e-03 |  4.15e-02 +/- 1.9e-03  |  4.19e-02 +/- 2.5e-03  |
 test_perturb_2                          |     +0.10 +/- 1.80     | +1.73e-02 +/- 3.20e-01 |  1.78e+01 +/- 1.4e-01  |  1.78e+01 +/- 2.9e-01  |
 test_proximal_freeb_jac                 |     -0.14 +/- 1.13     | -1.02e-02 +/- 8.50e-02 |  7.51e+00 +/- 3.9e-02  |  7.52e+00 +/- 7.5e-02  |
 test_solve_fixed_iter                   |     -1.42 +/- 58.93    | -7.34e-02 +/- 3.04e+00 |  5.08e+00 +/- 2.1e+00  |  5.15e+00 +/- 2.2e+00  |

@YigitElma
Copy link
Collaborator Author

My bad, to test numpy @f0uriest needs to make sure that orthax and interpax works fine with it. I guess interpax supports it but it is not released yet.

@YigitElma YigitElma marked this pull request as draft October 24, 2024 02:11
@f0uriest
Copy link
Member

My bad, to test numpy @f0uriest needs to make sure that orthax and interpax works fine with it. I guess interpax supports it but it is not released yet.

I'll try to do that tomorrow or Friday

@YigitElma
Copy link
Collaborator Author

My bad, to test numpy @f0uriest needs to make sure that orthax and interpax works fine with it. I guess interpax supports it but it is not released yet.

I'll try to do that tomorrow or Friday

No worries, I just wanted to test if it works or not.

@YigitElma YigitElma self-assigned this Oct 28, 2024
@YigitElma
Copy link
Collaborator Author

Temporarily changing the tests to use whatever matplotlib is installed in the first place. Downgrading to 3.7.2 causes tests to immediately fail.

@YigitElma
Copy link
Collaborator Author

Apparently, we get some ValueError: numpy masked arrays are not supported as direct inputs to JAX functions. Use arr.filled() to convert the value to a standard numpy array.. Someone can use this branch later to solve the problem. Until then, I am closing this PR since I won't work on it.

@YigitElma YigitElma closed this Oct 28, 2024
@f0uriest f0uriest reopened this Oct 28, 2024
@YigitElma
Copy link
Collaborator Author

This might change our matplotlib dependency! Check that too!

@YigitElma YigitElma added test_jax Run tests against different versions of JAX test_mpl labels Oct 30, 2024
@YigitElma YigitElma removed test_jax Run tests against different versions of JAX test_mpl labels Oct 30, 2024
@YigitElma
Copy link
Collaborator Author

The command in CONTRIBUTING.rst doesn't work even for master. pytest -k plotting --mpl-generate-path=tests/baseline/

@YigitElma
Copy link
Collaborator Author

  • I regenerated all baseline images (tho there is no visual difference). There was 1 extra baseline image that doesn't have a test anymore (test_qh_optimization3), I deleted that.
  • Upgraded CI workflows to use matplotlib 3.9.2

@YigitElma YigitElma changed the title Bump up numpy version? Support numpy 2.0.0 Nov 7, 2024
@YigitElma YigitElma changed the title Support numpy 2.0.0 Support numpy 2.0 Nov 7, 2024
@YigitElma YigitElma added the dependencies Issue related to libraries we depend on and how we interface with them label Nov 8, 2024
@YigitElma YigitElma marked this pull request as ready for review November 11, 2024 01:29
@YigitElma YigitElma requested review from a team, rahulgaur104, f0uriest, ddudt, dpanici, kianorr, sinaatalay and jjz73 and removed request for a team November 11, 2024 01:30
@dpanici dpanici added the skip_changelog No need to update changelog on this PR label Nov 15, 2024
@YigitElma YigitElma merged commit 35ec831 into master Nov 15, 2024
25 checks passed
@YigitElma YigitElma deleted the yge/numpy2 branch November 15, 2024 18:22
dpanici added a commit that referenced this pull request Nov 18, 2024
This was overlooked in #1319 , I think, which changed the scipy
requirement to remove the `<2.0` in `requirements.txt` but not anywhere
else
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 skip_changelog No need to update changelog on this PR test_jax Run tests against different versions of JAX test_mpl
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants