diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2010-05-10 03:41:02 +0000 |
---|---|---|
committer | Charles Harris <charlesr.harris@gmail.com> | 2010-05-10 03:41:02 +0000 |
commit | 427a9632db6ddc1e8659ab3191fe63873a8a188b (patch) | |
tree | c79dd77a275676ad62c9f3fd0d043044884a91a5 /numpy/fft/tests | |
parent | 81a86c775143d7335613fdb960d6267fc3d602f8 (diff) | |
download | numpy-427a9632db6ddc1e8659ab3191fe63873a8a188b.tar.gz |
BUG: Make fftshift and ifftshift accept integer arguments for the axes
value. The functions now match their documentation. Fixes ticket #1182,
patch from rgommers.
Diffstat (limited to 'numpy/fft/tests')
-rw-r--r-- | numpy/fft/tests/test_helper.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/numpy/fft/tests/test_helper.py b/numpy/fft/tests/test_helper.py index f757b6032..8ddac931f 100644 --- a/numpy/fft/tests/test_helper.py +++ b/numpy/fft/tests/test_helper.py @@ -26,6 +26,14 @@ class TestFFTShift(TestCase): for n in [1,4,9,100,211]: x = random((n,)) assert_array_almost_equal(ifftshift(fftshift(x)),x) + + def test_axes_keyword(self): + freqs = [[ 0, 1, 2], [ 3, 4, -4], [-3, -2, -1]] + shifted = [[-1, -3, -2], [ 2, 0, 1], [-4, 3, 4]] + assert_array_almost_equal(fftshift(freqs, axes=(0, 1)), shifted) + assert_array_almost_equal(fftshift(freqs, axes=0), fftshift(freqs, axes=(0,))) + assert_array_almost_equal(ifftshift(shifted, axes=(0, 1)), freqs) + assert_array_almost_equal(ifftshift(shifted, axes=0), ifftshift(shifted, axes=(0,))) class TestFFTFreq(TestCase): |