MCPcopy Create free account
hub / github.com/dask/dask / test_wrap_fftns

Function test_wrap_fftns

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

Source from the content-addressed store, hash-verified

178@pytest.mark.parametrize("funcname", all_nd_funcnames)
179@pytest.mark.parametrize("dtype", ["float32", "float64"])
180def test_wrap_fftns(modname, funcname, dtype):
181 fft_mod = pytest.importorskip(modname)
182 try:
183 func = getattr(fft_mod, funcname)
184 except AttributeError:
185 pytest.skip(f"`{modname}` missing function `{funcname}`.")
186
187 darrc = darr.astype(dtype).rechunk(darr.shape)
188 darr2c = darr2.astype(dtype).rechunk(darr2.shape)
189 nparrc = nparr.astype(dtype)
190
191 wfunc = fft_wrap(func)
192 assert wfunc(darrc).dtype == func(nparrc).dtype
193 assert wfunc(darrc).shape == func(nparrc).shape
194 assert_eq(wfunc(darrc), func(nparrc))
195 assert_eq(wfunc(darrc, axes=(1, 0)), func(nparrc, axes=(1, 0)))
196 assert_eq(wfunc(darr2c, axes=(0, 1)), func(nparrc, axes=(0, 1)))
197 assert_eq(
198 wfunc(darr2c, (darr2c.shape[0] - 1, darr2c.shape[1] - 1), (0, 1)),
199 func(nparrc, (nparrc.shape[0] - 1, nparrc.shape[1] - 1), (0, 1)),
200 )
201
202
203@pytest.mark.parametrize("n", [1, 2, 3, 6, 7])

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected