diff options
author | Oleksandr Pavlyk <oleksandr.pavlyk@intel.com> | 2019-04-16 22:06:39 -0500 |
---|---|---|
committer | Oleksandr Pavlyk <oleksandr.pavlyk@intel.com> | 2019-04-17 08:00:37 -0500 |
commit | 69c82504536bdd1270428c406245160a3650898a (patch) | |
tree | 0b03ff989c3bed377c691ee30ec9c205676ecaf7 /numpy/fft | |
parent | 4c977804b4eaadf5ac1b4eb1024f8167657e976d (diff) | |
download | numpy-69c82504536bdd1270428c406245160a3650898a.tar.gz |
TST: Added test_fftpocket.py::test_axes
Test for ND transforms with axes for invariance of
permutation of axes.
Diffstat (limited to 'numpy/fft')
-rw-r--r-- | numpy/fft/tests/test_pocketfft.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/numpy/fft/tests/test_pocketfft.py b/numpy/fft/tests/test_pocketfft.py index 08f80076a..db185cb21 100644 --- a/numpy/fft/tests/test_pocketfft.py +++ b/numpy/fft/tests/test_pocketfft.py @@ -138,6 +138,16 @@ class TestFFT1D(object): x_herm, np.fft.ihfft(np.fft.hfft(x_herm, norm="ortho"), norm="ortho")) + @pytest.mark.parametrize("op", [np.fft.fftn, np.fft.ifftn, + np.fft.rfftn, np.fft.irfftn]) + def test_axes(self, op): + x = random((30, 20, 10)) + axes = [(0, 1, 2), (0, 2, 1), (1, 0, 2), (1, 2, 0), (2, 0, 1), (2, 1, 0)] + for a in axes: + op_tr = op(np.transpose(x, a)) + tr_op = np.transpose(op(x, axes=a), a) + assert_array_almost_equal(op_tr, tr_op) + def test_all_1d_norm_preserving(self): # verify that round-trip transforms are norm-preserving x = random(30) |