MCPcopy Index your code
hub / github.com/dask/dask / test_wrap_ffts

Function test_wrap_ffts

dask/array/tests/test_fft.py:149–174  ·  view source on GitHub ↗
(modname, funcname, dtype)

Source from the content-addressed store, hash-verified

147@pytest.mark.parametrize("funcname", all_1d_funcnames)
148@pytest.mark.parametrize("dtype", ["float32", "float64"])
149def test_wrap_ffts(modname, funcname, dtype):
150 fft_mod = pytest.importorskip(modname)
151 try:
152 func = getattr(fft_mod, funcname)
153 except AttributeError:
154 pytest.skip(f"`{modname}` missing function `{funcname}`.")
155
156 darrc = darr.astype(dtype)
157 darr2c = darr2.astype(dtype)
158 nparrc = nparr.astype(dtype)
159
160 wfunc = fft_wrap(func)
161 assert wfunc(darrc).dtype == func(nparrc).dtype
162 assert wfunc(darrc).shape == func(nparrc).shape
163 assert_eq(wfunc(darrc), func(nparrc))
164 assert_eq(wfunc(darrc, axis=1), func(nparrc, axis=1))
165 assert_eq(wfunc(darr2c, axis=0), func(nparrc, axis=0))
166 assert_eq(wfunc(darrc, n=len(darrc) - 1), func(nparrc, n=len(darrc) - 1))
167 assert_eq(
168 wfunc(darrc, axis=1, n=darrc.shape[1] - 1),
169 func(nparrc, n=darrc.shape[1] - 1),
170 )
171 assert_eq(
172 wfunc(darr2c, axis=0, n=darr2c.shape[0] - 1),
173 func(nparrc, axis=0, n=darr2c.shape[0] - 1),
174 )
175
176
177@pytest.mark.parametrize("modname", ["numpy.fft", "scipy.fft"])

Callers

nothing calls this directly

Calls 5

fft_wrapFunction · 0.90
assert_eqFunction · 0.90
skipMethod · 0.80
funcFunction · 0.70
astypeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…