Skip to content

Commit

Permalink
Numpy 2.0 compatibility (#2392)
Browse files Browse the repository at this point in the history
* Fix numpy2.0 np.infty -> np.inf

Fixes `AttributeError: `np.infty` was removed in the NumPy 2.0 release. Use `np.inf` instead.`

* Require numpy>=2.0 at build time
  • Loading branch information
dweindl authored Jun 16, 2024
1 parent 6277a5e commit 6393c0c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
8 changes: 1 addition & 7 deletions python/sdist/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,7 @@
requires = [
"setuptools>=61",
"wheel",
# oldest-supported-numpy helps us to pin numpy here to the lowest supported
# version to have ABI-compatibility with the numpy version in the runtime
# environment. The undesirable alternative would be pinning the setup.py
# numpy requirement to the same version as here, which we want to avoid.
# cf. discussion at https://github.com/numpy/numpy/issues/5888
# (https://github.com/scipy/oldest-supported-numpy/)
"oldest-supported-numpy",
"numpy>=2.0",
"cmake-build-extension==0.6.0",
]
build-backend = "setuptools.build_meta"
Expand Down
2 changes: 1 addition & 1 deletion python/tests/test_preequilibration.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def preeq_fixture(pysb_example_presimulation_module):

edata_preeq = amici.ExpData(edata)
edata_preeq.t_presim = 0
edata_preeq.setTimepoints([np.infty])
edata_preeq.setTimepoints([np.inf])
edata_preeq.fixedParameters = edata.fixedParametersPreequilibration
edata_preeq.fixedParametersPresimulation = ()
edata_preeq.fixedParametersPreequilibration = ()
Expand Down

0 comments on commit 6393c0c

Please sign in to comment.