#NEWLINE# def test_axes_argument( self ) : #NEWLINE# #INDENT# plane1 = [ [ 1 , 2 , 3 ] , [ 4 , 5 , 6 ] , [ 7 , 8 , 9 ] ] #NEWLINE# plane2 = [ [ 10 , 11 , 12 ] , [ 13 , 14 , 15 ] , [ 16 , 17 , 18 ] ] #NEWLINE# plane3 = [ [ 19 , 20 , 21 ] , [ 22 , 23 , 24 ] , [ 25 , 26 , 27 ] ] #NEWLINE# ki_plane1 = [ [ 1 , 2 , 3 ] , [ 10 , 11 , 12 ] , [ 19 , 20 , 21 ] ] #NEWLINE# ki_plane2 = [ [ 4 , 5 , 6 ] , [ 13 , 14 , 15 ] , [ 22 , 23 , 24 ] ] #NEWLINE# ki_plane3 = [ [ 7 , 8 , 9 ] , [ 16 , 17 , 18 ] , [ 25 , 26 , 27 ] ] #NEWLINE# jk_plane1 = [ [ 1 , 10 , 19 ] , [ 4 , 13 , 22 ] , [ 7 , 16 , 25 ] ] #NEWLINE# jk_plane2 = [ [ 2 , 11 , 20 ] , [ 5 , 14 , 23 ] , [ 8 , 17 , 26 ] ] #NEWLINE# jk_plane3 = [ [ 3 , 12 , 21 ] , [ 6 , 15 , 24 ] , [ 9 , 18 , 27 ] ] #NEWLINE# kj_plane1 = [ [ 1 , 4 , 7 ] , [ 10 , 13 , 16 ] , [ 19 , 22 , 25 ] ] #NEWLINE# kj_plane2 = [ [ 2 , 5 , 8 ] , [ 11 , 14 , 17 ] , [ 20 , 23 , 26 ] ] #NEWLINE# kj_plane3 = [ [ 3 , 6 , 9 ] , [ 12 , 15 , 18 ] , [ 21 , 24 , 27 ] ] #NEWLINE# ij_plane1 = [ [ 1 , 4 , 7 ] , [ 2 , 5 , 8 ] , [ 3 , 6 , 9 ] ] #NEWLINE# ij_plane2 = [ [ 10 , 13 , 16 ] , [ 11 , 14 , 17 ] , [ 12 , 15 , 18 ] ] #NEWLINE# ij_plane3 = [ [ 19 , 22 , 25 ] , [ 20 , 23 , 26 ] , [ 21 , 24 , 27 ] ] #NEWLINE# ik_plane1 = [ [ 1 , 10 , 19 ] , [ 2 , 11 , 20 ] , [ 3 , 12 , 21 ] ] #NEWLINE# ik_plane2 = [ [ 4 , 13 , 22 ] , [ 5 , 14 , 23 ] , [ 6 , 15 , 24 ] ] #NEWLINE# ik_plane3 = [ [ 7 , 16 , 25 ] , [ 8 , 17 , 26 ] , [ 9 , 18 , 27 ] ] #NEWLINE# ijk_space = [ jk_plane1 , jk_plane2 , jk_plane3 ] #NEWLINE# ikj_space = [ kj_plane1 , kj_plane2 , kj_plane3 ] #NEWLINE# jik_space = [ ik_plane1 , ik_plane2 , ik_plane3 ] #NEWLINE# jki_space = [ ki_plane1 , ki_plane2 , ki_plane3 ] #NEWLINE# kij_space = [ ij_plane1 , ij_plane2 , ij_plane3 ] #NEWLINE# x = array ( [ plane1 , plane2 , plane3 ] ) #NEWLINE# assert_array_almost_equal ( fftn ( x ) , fftn ( x , axes = ( ( - 3 ) , ( - 2 ) , ( - 1 ) ) ) ) #NEWLINE# assert_array_almost_equal ( fftn ( x ) , fftn ( x , axes = ( 0 , 1 , 2 ) ) ) #NEWLINE# y = fftn ( x , axes = ( 2 , 1 , 0 ) ) #NEWLINE# assert_array_almost_equal ( swapaxes ( y , ( - 1 ) , ( - 3 ) ) , fftn ( ijk_space ) ) #NEWLINE# y = fftn ( x , axes = ( 2 , 0 , 1 ) ) #NEWLINE# assert_array_almost_equal ( swapaxes ( swapaxes ( y , ( - 1 ) , ( - 3 ) ) , ( - 1 ) , ( - 2 ) ) , fftn ( ikj_space ) ) #NEWLINE# y = fftn ( x , axes = ( 1 , 2 , 0 ) ) #NEWLINE# assert_array_almost_equal ( swapaxes ( swapaxes ( y , ( - 1 ) , ( - 3 ) ) , ( - 3 ) , ( - 2 ) ) , fftn ( jik_space ) ) #NEWLINE# y = fftn ( x , axes = ( 1 , 0 , 2 ) ) #NEWLINE# assert_array_almost_equal ( swapaxes ( y , ( - 2 ) , ( - 3 ) ) , fftn ( jki_space ) ) #NEWLINE# y = fftn ( x , axes = ( 0 , 2 , 1 ) ) #NEWLINE# assert_array_almost_equal ( swapaxes ( y , ( - 2 ) , ( - 1 ) ) , fftn ( kij_space ) ) #NEWLINE# y = fftn ( x , axes = ( ( - 2 ) , ( - 1 ) ) ) #NEWLINE# assert_array_almost_equal ( fftn ( plane1 ) , y [ 0 ] ) #NEWLINE# assert_array_almost_equal ( fftn ( plane2 ) , y [ 1 ] ) #NEWLINE# assert_array_almost_equal ( fftn ( plane3 ) , y [ 2 ] ) #NEWLINE# y = fftn ( x , axes = ( 1 , 2 ) ) #NEWLINE# assert_array_almost_equal ( fftn ( plane1 ) , y [ 0 ] ) #NEWLINE# assert_array_almost_equal ( fftn ( plane2 ) , y [ 1 ] ) #NEWLINE# assert_array_almost_equal ( fftn ( plane3 ) , y [ 2 ] ) #NEWLINE# y = fftn ( x , axes = ( ( - 3 ) , ( - 2 ) ) ) #NEWLINE# assert_array_almost_equal ( fftn ( x [ : , : , 0 ] ) , y [ : , : , 0 ] ) #NEWLINE# assert_array_almost_equal ( fftn ( x [ : , : , 1 ] ) , y [ : , : , 1 ] ) #NEWLINE# assert_array_almost_equal ( fftn ( x [ : , : , 2 ] ) , y [ : , : , 2 ] ) #NEWLINE# y = fftn ( x , axes = ( ( - 3 ) , ( - 1 ) ) ) #NEWLINE# assert_array_almost_equal ( fftn ( x [ : , 0 , : ] ) , y [ : , 0 , : ] ) #NEWLINE# assert_array_almost_equal ( fftn ( x [ : , 1 , : ] ) , y [ : , 1 , : ] ) #NEWLINE# assert_array_almost_equal ( fftn ( x [ : , 2 , : ] ) , y [ : , 2 , : ] ) #NEWLINE# y = fftn ( x , axes = ( ( - 1 ) , ( - 2 ) ) ) #NEWLINE# assert_array_almost_equal ( fftn ( ij_plane1 ) , swapaxes ( y [ 0 ] , ( - 2 ) , ( - 1 ) ) ) #NEWLINE# assert_array_almost_equal ( fftn ( ij_plane2 ) , swapaxes ( y [ 1 ] , ( - 2 ) , ( - 1 ) ) ) #NEWLINE# assert_array_almost_equal ( fftn ( ij_plane3 ) , swapaxes ( y [ 2 ] , ( - 2 ) , ( - 1 ) ) ) #NEWLINE# y = fftn ( x , axes = ( ( - 1 ) , ( - 3 ) ) ) #NEWLINE# assert_array_almost_equal ( fftn ( ik_plane1 ) , swapaxes ( y [ : , 0 , : ] , ( - 1 ) , ( - 2 ) ) ) #NEWLINE# assert_array_almost_equal ( fftn ( ik_plane2 ) , swapaxes ( y [ : , 1 , : ] , ( - 1 ) , ( - 2 ) ) ) #NEWLINE# assert_array_almost_equal ( fftn ( ik_plane3 ) , swapaxes ( y [ : , 2 , : ] , ( - 1 ) , ( - 2 ) ) ) #NEWLINE# y = fftn ( x , axes = ( ( - 2 ) , ( - 3 ) ) ) #NEWLINE# assert_array_almost_equal ( fftn ( jk_plane1 ) , swapaxes ( y [ : , : , 0 ] , ( - 1 ) , ( - 2 ) ) ) #NEWLINE# assert_array_almost_equal ( fftn ( jk_plane2 ) , swapaxes ( y [ : , : , 1 ] , ( - 1 ) , ( - 2 ) ) ) #NEWLINE# assert_array_almost_equal ( fftn ( jk_plane3 ) , swapaxes ( y [ : , : , 2 ] , ( - 1 ) , ( - 2 ) ) ) #NEWLINE# y = fftn ( x , axes = ( ( - 1 ) , ) ) #NEWLINE# for i in range ( 3 ) : #NEWLINE# #INDENT# for j in range ( 3 ) : #NEWLINE# #INDENT# assert_array_almost_equal ( fft ( x [ i , j , : ] ) , y [ i , j , : ] ) #NEWLINE# #UNINDENT# #UNINDENT# y = fftn ( x , axes = ( ( - 2 ) , ) ) #NEWLINE# for i in range ( 3 ) : #NEWLINE# #INDENT# for j in range ( 3 ) : #NEWLINE# #INDENT# assert_array_almost_equal ( fft ( x [ i , : , j ] ) , y [ i , : , j ] ) #NEWLINE# #UNINDENT# #UNINDENT# y = fftn ( x , axes = ( 0 , ) ) #NEWLINE# for i in range ( 3 ) : #NEWLINE# #INDENT# for j in range ( 3 ) : #NEWLINE# #INDENT# assert_array_almost_equal ( fft ( x [ : , i , j ] ) , y [ : , i , j ] ) #NEWLINE# #UNINDENT# #UNINDENT# y = fftn ( x , axes = ( ) ) #NEWLINE# assert_array_almost_equal ( y , x )