Skip to content
New issue

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

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

Already on GitHub? # to your account

Numpy 2.0 compatibility #2392

Merged
merged 3 commits into from
Jun 16, 2024
Merged

Numpy 2.0 compatibility #2392

merged 3 commits into from
Jun 16, 2024

Conversation

dweindl
Copy link
Member

@dweindl dweindl commented Apr 3, 2024

  • Require numpy>=2.0 at build time (the run time requirement remains unaffected)
    oldest-supported-numpy is no longer necessary, see numpy docs for details
  • Fix numpy2.0 np.infty -> np.inf
    Fixes AttributeError: np.inftywas removed in the NumPy 2.0 release. Usenp.inf instead.
    Missed in np.Inf -> np.inf for numpy 2.0 compatibility #2422.

NOTE: There are some test failures (all of type ValueError: could not convert string to float: 'np.float64(0.10132835605031565)') related to today's numpy 2.0 release which is incompatible with the current sympy 1.12. This will be fixed in sympy 1.13 for which there is already a release candidate and which I guess will be released shortly, so I would ignore those in amici for now.

Closes #2377

@dweindl dweindl self-assigned this Apr 16, 2024
Copy link

codecov bot commented Apr 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 36.66%. Comparing base (6277a5e) to head (48ace67).
Report is 27 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff            @@
##           develop    #2392   +/-   ##
========================================
  Coverage    36.66%   36.66%           
========================================
  Files          103      103           
  Lines        14881    14881           
  Branches      1388     1388           
========================================
  Hits          5456     5456           
  Misses        9116     9116           
  Partials       309      309           
Flag Coverage Δ
petab 36.66% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Fixes `AttributeError: `np.infty` was removed in the NumPy 2.0 release. Use `np.inf` instead.`
@dweindl dweindl changed the title Test numpy 2.0 rc Fix numpy2.0 np.infty -> np.inf Jun 16, 2024
@dweindl dweindl mentioned this pull request Jun 16, 2024
2 tasks
@dweindl dweindl marked this pull request as ready for review June 16, 2024 14:39
@dweindl dweindl requested a review from a team as a code owner June 16, 2024 14:39
@dweindl dweindl changed the title Fix numpy2.0 np.infty -> np.inf Numpy 2.0 compatibility Jun 16, 2024
Copy link

socket-security bot commented Jun 16, 2024

New and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher

🚮 Removed packages: pypi/oldest-supported-numpy@2023.12.21, pypi/oldest-supported-numpy@2023.12.21

View full report↗︎

@dweindl dweindl merged commit 6393c0c into AMICI-dev:develop Jun 16, 2024
13 of 20 checks passed
@dweindl dweindl deleted the test_numpy2 branch June 16, 2024 16:34
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants