#NEWLINE# def test_derivatives( self ) : #NEWLINE# #INDENT# x = array ( [ 1 , 2 , 3 , 4 , 5 ] ) #NEWLINE# y = array ( [ 1 , 2 , 3 , 4 , 5 ] ) #NEWLINE# z = array ( [ [ 1 , 2 , 1 , 2 , 1 ] , [ 1 , 2 , 1 , 2 , 1 ] , [ 1 , 2 , 3 , 2 , 1 ] , [ 1 , 2 , 2 , 2 , 1 ] , [ 1 , 2 , 1 , 2 , 1 ] ] ) #NEWLINE# dx = array ( [ 0 , 0 , ( 2.0 / 3 ) , 0 , 0 ] ) #NEWLINE# dy = array ( [ 4 , ( - 1 ) , 0 , ( - 0.25 ) , ( - 4 ) ] ) #NEWLINE# dxdy = ( array ( [ 160 , 65 , 0 , 55 , 32 ] ) / 24.0 ) #NEWLINE# lut = RectBivariateSpline ( x , y , z ) #NEWLINE# assert_array_almost_equal ( lut ( x , y , dx = 1 , grid = False ) , dx ) #NEWLINE# assert_array_almost_equal ( lut ( x , y , dy = 1 , grid = False ) , dy ) #NEWLINE# assert_array_almost_equal ( lut ( x , y , dx = 1 , dy = 1 , grid = False ) , dxdy )