Skip to content

add support for out keyword #157

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

Merged
merged 7 commits into from
Apr 25, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
use NumpyVersion
  • Loading branch information
vtavana committed Apr 24, 2025
commit 2b4a40833cefadd1380a606a6dedef166ad1f7ba
4 changes: 2 additions & 2 deletions mkl_fft/_numpy_fft.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def _cook_nd_args(a, s=None, axes=None, invreal=False):
shapeless = False
s = list(s)
if axes is None:
if not shapeless and np.__version__ >= "2.0":
if not shapeless and np.lib.NumpyVersion(np.__version__) >= "2.0.0":
msg = (
"`axes` should not be `None` if `s` is not `None` "
"(Deprecated in NumPy 2.0). In a future version of NumPy, "
Expand All @@ -85,7 +85,7 @@ def _cook_nd_args(a, s=None, axes=None, invreal=False):
raise ValueError("Shape and axes have different lengths.")
if invreal and shapeless:
s[-1] = (a.shape[axes[-1]] - 1) * 2
if None in s and np.__version__ >= "2.0":
if None in s and np.lib.NumpyVersion(np.__version__) >= "2.0.0":
msg = (
"Passing an array containing `None` values to `s` is "
"deprecated in NumPy 2.0 and will raise an error in "
Expand Down
3 changes: 2 additions & 1 deletion mkl_fft/tests/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,6 @@
import pytest

requires_numpy_2 = pytest.mark.skipif(
np.__version__ < "2.0", reason="Requires NumPy >= 2.0"
np.lib.NumpyVersion(np.__version__) < "2.0.0",
reason="Requires NumPy >= 2.0.0",
)