#NEWLINE# def test_nearest( ) : #NEWLINE# #INDENT# x = np . arange ( 10 ) #NEWLINE# d = da . from_array ( x , chunks = ( 5 , 5 ) ) #NEWLINE# e = nearest ( d , axis = 0 , depth = 2 ) #NEWLINE# expected = np . array ( [ 0 , 0 , 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 9 , 9 ] ) #NEWLINE# assert eq ( e , expected ) #NEWLINE# e = nearest ( d , axis = 0 , depth = 1 ) #NEWLINE# expected = np . array ( [ 0 , 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 9 ] ) #NEWLINE# assert eq ( e , e )