def _neighbor_test(nr_points, dim, bucket_size, radius):
 kdt = _CKDTree.KDTree(dim, bucket_size)
 coords = random.random((nr_points, dim))
 kdt.set_data(coords)
 neighbors = kdt.neighbor_search(radius)
 r = [neighbor.radius for neighbor in neighbors]
 if (r is None):
  l1 = 0
 else:
  l1 = len(r)
 neighbors = kdt.neighbor_simple_search(radius)
 r = [neighbor.radius for neighbor in neighbors]
 if (r is None):
  l2 = 0
 else:
  l2 = len(r)
 if (l1 == l2):
  return True
 else:
  print(('Not passed: %i != %i.' % (l1, l2)))
  return False

def _neighbor_test ( nr_points , dim , bucket_size , radius ) : kdt = _CKDTree . KDTree ( dim , bucket_size ) coords = random . random ( ( nr_points , dim ) ) kdt . set_data ( coords ) neighbors = kdt . neighbor_search ( radius ) r = [ neighbor . radius for neighbor in neighbors ] if ( r is None ) : l1 = 0 else : l1 = len ( r ) neighbors = kdt . neighbor_simple_search ( radius ) r = [ neighbor . radius for neighbor in neighbors ] if ( r is None ) : l2 = 0 else : l2 = len ( r ) if ( l1 == l2 ) : return True else : print ( ( 'Not passed: %i != %i.' % ( l1 , l2 ) ) ) return False
test all fixed radius neighbor search .