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

Function test_fftshift_identity

dask/array/tests/test_fft.py:265–281  ·  view source on GitHub ↗
(funcname1, funcname2, shape, chunks, axes)

Source from the content-addressed store, hash-verified

263 [[(5, 6, 7), (2, 3, 4)], [(5, 6, 7), (2, 6, 4)], [(5, 6, 7), (5, 6, 7)]],
264)
265def test_fftshift_identity(funcname1, funcname2, shape, chunks, axes):
266 da_func1 = getattr(da.fft, funcname1)
267 da_func2 = getattr(da.fft, funcname2)
268
269 a = np.arange(np.prod(shape)).reshape(shape)
270 d = da.from_array(a, chunks=chunks)
271
272 d_r = da_func1(da_func2(d, axes), axes)
273
274 for each_d_chunks, each_d_r_chunks in zip(d.chunks, d_r.chunks):
275 if len(each_d_chunks) == 1:
276 assert len(each_d_r_chunks) == 1
277 assert each_d_r_chunks == each_d_chunks
278 else:
279 assert len(each_d_r_chunks) != 1
280
281 assert_eq(d_r, d)
282
283
284@pytest.mark.parametrize("modname", ["numpy.fft", "scipy.fft", "scipy.fftpack"])

Callers

nothing calls this directly

Calls 4

assert_eqFunction · 0.90
reshapeMethod · 0.80
arangeMethod · 0.45
prodMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…