summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatti Picus <matti.picus@gmail.com>2019-04-18 14:50:10 +0300
committerGitHub <noreply@github.com>2019-04-18 14:50:10 +0300
commit0fd5f2506bf2f41b023392c945312e5a1a3eb819 (patch)
tree1f83b5bba2f5e2f47f762a6ad251e564da03fab7
parent3c3ba10f4f8b0050a3b6d57a3e4888ae3d8f57dd (diff)
parent69c82504536bdd1270428c406245160a3650898a (diff)
downloadnumpy-0fd5f2506bf2f41b023392c945312e5a1a3eb819.tar.gz
Merge pull request #13354 from IntelPython/add-rfftn-axes-test
TST: Added test_fftpocket.py::test_axes
-rw-r--r--numpy/fft/tests/test_pocketfft.py10
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)