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

Function test_fftshift

dask/array/tests/test_fft.py:237–254  ·  view source on GitHub ↗
(funcname, shape, chunks, axes)

Source from the content-addressed store, hash-verified

235 [[(5, 6, 7), (2, 3, 4)], [(5, 6, 7), (2, 6, 4)], [(5, 6, 7), (5, 6, 7)]],
236)
237def test_fftshift(funcname, shape, chunks, axes):
238 np_func = getattr(np.fft, funcname)
239 da_func = getattr(da.fft, funcname)
240
241 a = np.arange(np.prod(shape)).reshape(shape)
242 d = da.from_array(a, chunks=chunks)
243
244 a_r = np_func(a, axes)
245 d_r = da_func(d, axes)
246
247 for each_d_chunks, each_d_r_chunks in zip(d.chunks, d_r.chunks):
248 if len(each_d_chunks) == 1:
249 assert len(each_d_r_chunks) == 1
250 assert each_d_r_chunks == each_d_chunks
251 else:
252 assert len(each_d_r_chunks) != 1
253
254 assert_eq(d_r, a_r)
255
256
257@pytest.mark.parametrize(

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