#NEWLINE# @ pytest . mark . skipif ( 'YT_VERSION is None' ) #NEWLINE# def test_axis_ordering_cartesian( ) : #NEWLINE# #INDENT# from . yt_compat import get_frb #NEWLINE# x = np . linspace ( ( - 1 ) , 1 , 9 ) #NEWLINE# y = np . linspace ( ( - 2 ) , 2 , 17 ) #NEWLINE# z = np . linspace ( ( - 3 ) , 3 , 33 ) #NEWLINE# density = ( np . arange ( 32 ) [ : , None , None ] * np . ones ( ( 32 , 16 , 8 ) ) ) #NEWLINE# g = CartesianGrid ( x , y , z ) #NEWLINE# g [ 'density' ] = [ ] #NEWLINE# g [ 'density' ] . append ( density ) #NEWLINE# from yt.mods import ProjectionPlot , SlicePlot #NEWLINE# pf = g . to_yt ( ) #NEWLINE# for ( iz , z ) in enumerate ( g . z ) : #NEWLINE# #INDENT# prj = SlicePlot ( pf , 'z' , [ 'density' ] , center = [ 0.0 , 0.0 , z ] ) #NEWLINE# np . testing . assert_allclose ( get_frb ( prj , 'density' ) . min ( ) , iz ) #NEWLINE# np . testing . assert_allclose ( get_frb ( prj , 'density' ) . max ( ) , iz )