Skip to content

Commit c434e4d

Browse files
committed
FFT freq tests
1 parent ae0017a commit c434e4d

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

array_api_tests/test_fft.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -291,8 +291,18 @@ def test_ihfft(x, data):
291291
assert_n_axis_shape("ihfft", x=x, n=n, axis=axis, out=out, size_gt_1=True)
292292

293293

294+
@given( n=st.integers(1, 100), kw=hh.kwargs(d=st.floats(0.1, 5)))
295+
def test_fftfreq(n, kw):
296+
out = xp.fft.fftfreq(n, **kw)
297+
ph.assert_shape("fftfreq", out_shape=out.shape, expected=(n,), kw={"n": n})
298+
299+
300+
@given(n=st.integers(1, 100), kw=hh.kwargs(d=st.floats(0.1, 5)))
301+
def test_rfftfreq(n, kw):
302+
out = xp.fft.rfftfreq(n, **kw)
303+
ph.assert_shape("rfftfreq", out_shape=out.shape, expected=(n // 2 + 1,), kw={"n": n})
304+
305+
294306
# TODO:
295-
# fftfreq
296-
# rfftfreq
297307
# fftshift
298308
# ifftshift

0 commit comments

Comments
 (0)