Skip to content

Commit 2b4a408

Browse files
committed
use NumpyVersion
1 parent a163fa2 commit 2b4a408

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

mkl_fft/_numpy_fft.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def _cook_nd_args(a, s=None, axes=None, invreal=False):
7070
shapeless = False
7171
s = list(s)
7272
if axes is None:
73-
if not shapeless and np.__version__ >= "2.0":
73+
if not shapeless and np.lib.NumpyVersion(np.__version__) >= "2.0.0":
7474
msg = (
7575
"`axes` should not be `None` if `s` is not `None` "
7676
"(Deprecated in NumPy 2.0). In a future version of NumPy, "
@@ -85,7 +85,7 @@ def _cook_nd_args(a, s=None, axes=None, invreal=False):
8585
raise ValueError("Shape and axes have different lengths.")
8686
if invreal and shapeless:
8787
s[-1] = (a.shape[axes[-1]] - 1) * 2
88-
if None in s and np.__version__ >= "2.0":
88+
if None in s and np.lib.NumpyVersion(np.__version__) >= "2.0.0":
8989
msg = (
9090
"Passing an array containing `None` values to `s` is "
9191
"deprecated in NumPy 2.0 and will raise an error in "

mkl_fft/tests/helper.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,6 @@
2929
import pytest
3030

3131
requires_numpy_2 = pytest.mark.skipif(
32-
np.__version__ < "2.0", reason="Requires NumPy >= 2.0"
32+
np.lib.NumpyVersion(np.__version__) < "2.0.0",
33+
reason="Requires NumPy >= 2.0.0",
3334
)

0 commit comments

Comments
 (0)