#NEWLINE# def test_ckdtree_box( ) : #NEWLINE# #INDENT# n = 2000 #NEWLINE# m = 2 #NEWLINE# k = 3 #NEWLINE# np . random . seed ( 1234 ) #NEWLINE# data = np . random . uniform ( size = ( n , m ) ) #NEWLINE# kdtree = cKDTree ( data , leafsize = 1 , boxsize = 1.0 ) #NEWLINE# kdtree2 = cKDTree ( data , leafsize = 1 ) #NEWLINE# ( dd , ii ) = kdtree . query ( data , k ) #NEWLINE# ( dd1 , ii1 ) = kdtree . query ( ( data + 1.0 ) , k ) #NEWLINE# assert_almost_equal ( dd , dd1 ) #NEWLINE# assert_equal ( ii , ii1 ) #NEWLINE# ( dd1 , ii1 ) = kdtree . query ( ( data - 1.0 ) , k ) #NEWLINE# assert_almost_equal ( dd , dd1 ) #NEWLINE# assert_equal ( ii , ii1 ) #NEWLINE# ( dd2 , ii2 ) = simulate_periodic_box ( kdtree2 , n , k , boxsize = 1.0 ) #NEWLINE# assert_almost_equal ( dd , dd2 ) #NEWLINE# assert_equal ( ii , ii2 )