Skip to content

Commit 0802c25

Browse files
committed
fix linting of reimplemented numpy helpers
numpy constructor argument signatures were updated with a device keyword in numpy 2 and pylint fails as a result
1 parent 0098901 commit 0802c25

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

mkl_fft/interfaces/_numpy_helper.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,17 @@ def fftfreq(n, d=1.0, device=None):
8383
if not isinstance(n, (int, np.integer)):
8484
raise ValueError("n should be an integer")
8585
val = 1.0 / (n * d)
86+
# pylint: disable=unexpected-keyword-arg
8687
results = np.empty(n, int, device=device)
88+
# pylint: enable=unexpected-keyword-arg
8789
N = (n - 1) // 2 + 1
90+
# pylint: disable=unexpected-keyword-arg
8891
p1 = np.arange(0, N, dtype=int, device=device)
92+
# pylint: enable=unexpected-keyword-arg
8993
results[:N] = p1
94+
# pylint: disable=unexpected-keyword-arg
9095
p2 = np.arange(-(n // 2), 0, dtype=int, device=device)
96+
# pylint: enable=unexpected-keyword-arg
9197
results[N:] = p2
9298
return results * val
9399

@@ -104,5 +110,7 @@ def rfftfreq(n, d=1.0, device=None):
104110
raise ValueError("n should be an integer")
105111
val = 1.0 / (n * d)
106112
N = n // 2 + 1
113+
# pylint: disable=unexpected-keyword-arg
107114
results = np.arange(0, N, dtype=int, device=device)
115+
# pylint: enable=unexpected-keyword-arg
108116
return results * val

0 commit comments

Comments
 (0)