Skip to content

Commit

Permalink
ENH: Allow numpy 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacob-Stevens-Haas committed Aug 26, 2024
1 parent 4440536 commit cfe2a4e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ readme = "README.rst"

[tool.poetry.dependencies]
python = "^3.9"
numpy = "^1.18.3"
numpy = ">=1.18.3"
scipy = "^1.4.1"
scikit-learn = "^1"
importlib-metadata = "^7.1.0"
Expand Down
7 changes: 6 additions & 1 deletion tests/test_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
import numpy as np
import inspect

if int(np.__version__.split(".")[0]) == 1:
from numpy.polynomial.polyutils import RankWarning
else:
from numpy.exceptions import RankWarning

def test_register():
# Check that every class is registered in methods
class_list = inspect.getmembers(derivative.dlocal, inspect.isclass)\
Expand Down Expand Up @@ -89,7 +94,7 @@ def test_small():

# savitzky_golay - RankWarning: The fit may be poorly conditioned if order >= points in window
kwargs = {'left': 2, 'right': 2, 'iwindow': True, 'order': 2}
with pytest.warns(UserWarning): # numpy.RankWarning is of type UserWarning
with pytest.warns(RankWarning):
assert two.shape == dxdt(two, two, kind='savitzky_golay', **kwargs).shape
assert three.shape == dxdt(three, three, kind='savitzky_golay', **kwargs).shape

Expand Down

0 comments on commit cfe2a4e

Please sign in to comment.