#NEWLINE# def test_simple_2d( self ) : #NEWLINE# #INDENT# np . random . seed ( 1234 ) #NEWLINE# c = np . random . rand ( 4 , 5 , 6 , 7 ) #NEWLINE# x = np . linspace ( 0 , 1 , ( 6 + 1 ) ) #NEWLINE# y = ( np . linspace ( 0 , 1 , ( 7 + 1 ) ) ** 2 ) #NEWLINE# xi = np . random . rand ( 200 ) #NEWLINE# yi = np . random . rand ( 200 ) #NEWLINE# v1 = np . empty ( [ len ( xi ) , 1 ] , dtype = c . dtype ) #NEWLINE# v1 . fill ( np . nan ) #NEWLINE# _ppoly . evaluate_nd ( c . reshape ( ( 4 * 5 ) , ( 6 * 7 ) , 1 ) , ( x , y ) , np . array ( [ 4 , 5 ] , dtype = np . intc ) , np . c_ [ ( xi , yi ) ] , np . array ( [ 0 , 0 ] , dtype = np . intc ) , 1 , v1 ) #NEWLINE# v1 = v1 . ravel ( ) #NEWLINE# v2 = _ppoly2d_eval ( c , ( x , y ) , xi , yi ) #NEWLINE# assert_allclose ( v1 , v2 ) #NEWLINE# p = NdPPoly ( c , ( x , y ) ) #NEWLINE# for nu in ( None , ( 0 , 0 ) , ( 0 , 1 ) , ( 1 , 0 ) , ( 2 , 3 ) , ( 9 , 2 ) ) : #NEWLINE# #INDENT# v1 = p ( np . c_ [ ( xi , yi ) ] , nu = nu ) #NEWLINE# v2 = _ppoly2d_eval ( c , ( x , y ) , xi , yi , nu = nu ) #NEWLINE# assert_allclose ( v1 , v2 , err_msg = repr ( nu ) )