#NEWLINE# def test_derivatives_grid( self ) : #NEWLINE# #INDENT# y = linspace ( 0.01 , ( ( 2 * pi ) - 0.01 ) , 7 ) #NEWLINE# x = linspace ( 0.01 , ( pi - 0.01 ) , 7 ) #NEWLINE# z = array ( [ [ 1 , 2 , 1 , 2 , 1 , 2 , 1 ] , [ 1 , 2 , 1 , 2 , 1 , 2 , 1 ] , [ 1 , 2 , 3 , 2 , 1 , 2 , 1 ] , [ 1 , 2 , 2 , 2 , 1 , 2 , 1 ] , [ 1 , 2 , 1 , 2 , 1 , 2 , 1 ] , [ 1 , 2 , 2 , 2 , 1 , 2 , 1 ] , [ 1 , 2 , 1 , 2 , 1 , 2 , 1 ] ] ) #NEWLINE# lut = RectSphereBivariateSpline ( x , y , z ) #NEWLINE# y = linspace ( 0.02 , ( ( 2 * pi ) - 0.02 ) , 7 ) #NEWLINE# x = linspace ( 0.02 , ( pi - 0.02 ) , 7 ) #NEWLINE# assert_allclose ( lut ( x , y , dtheta = 1 ) , _numdiff_2d ( lut , x , y , dx = 1 ) , rtol = 0.0001 , atol = 0.0001 ) #NEWLINE# assert_allclose ( lut ( x , y , dphi = 1 ) , _numdiff_2d ( lut , x , y , dy = 1 ) , rtol = 0.0001 , atol = 0.0001 ) #NEWLINE# assert_allclose ( lut ( x , y , dtheta = 1 , dphi = 1 ) , _numdiff_2d ( self , x , y , dx = 1 , dy = 1 , eps = 1e-06 ) , rtol = 0.001 , atol = 0.001 )