#NEWLINE# @ tag ( 'important' ) #NEWLINE# def test_usecase1( self ) : #NEWLINE# #INDENT# pyfunc = usecase1 #NEWLINE# mystruct_dt = numpy . dtype ( [ ( 'p' , numpy . float64 ) , ( 'row' , numpy . float64 ) , ( 'col' , numpy . float64 ) ] ) #NEWLINE# mystruct = numpy_support . from_dtype ( mystruct_dt ) #NEWLINE# cres = compile_isolated ( pyfunc , ( mystruct [ : ] , mystruct [ : ] ) ) #NEWLINE# cfunc = cres . entry_point #NEWLINE# st1 = numpy . recarray ( 3 , dtype = mystruct_dt ) #NEWLINE# st2 = numpy . recarray ( 3 , dtype = mystruct_dt ) #NEWLINE# st1 . p = ( numpy . arange ( st1 . size ) + 1 ) #NEWLINE# st1 . row = ( numpy . arange ( st1 . size ) + 1 ) #NEWLINE# st1 . col = ( numpy . arange ( st1 . size ) + 1 ) #NEWLINE# st2 . p = ( numpy . arange ( st2 . size ) + 1 ) #NEWLINE# st2 . row = ( numpy . arange ( st2 . size ) + 1 ) #NEWLINE# st2 . col = ( numpy . arange ( st2 . size ) + 1 ) #NEWLINE# expect1 = st1 . copy ( ) #NEWLINE# expect2 = st2 . copy ( ) #NEWLINE# got1 = expect1 . copy ( ) #NEWLINE# got2 = expect2 . copy ( ) #NEWLINE# pyfunc ( expect1 , expect2 ) #NEWLINE# cfunc ( got1 , got2 ) #NEWLINE# self . assertTrue ( numpy . all ( ( expect1 == got1 ) ) ) #NEWLINE# self . assertTrue ( numpy . all ( ( expect2 == got2 ) ) )