#NEWLINE# def test_consistency_with_neighbors( self ) : #NEWLINE# #INDENT# M = self . T1 . sparse_distance_matrix ( self . T2 , self . r ) #NEWLINE# r = self . T1 . query_ball_tree ( self . T2 , self . r ) #NEWLINE# for ( i , l ) in enumerate ( r ) : #NEWLINE# #INDENT# for j in l : #NEWLINE# #INDENT# assert_almost_equal ( M [ ( i , j ) ] , self . distance ( self . T1 . data [ i ] , self . T2 . data [ j ] , self . p ) , decimal = 14 ) #NEWLINE# #UNINDENT# #UNINDENT# for ( ( i , j ) , d ) in M . items ( ) : #NEWLINE# #INDENT# assert_ ( ( j in r [ i ] ) )