def test_radius_neighbors_boundary_handling():
 X = np.array([[1.5], [3.0], [3.01]])
 radius = 3.0
 for algorithm in ALGORITHMS:
  nbrs = neighbors.NearestNeighbors(radius=radius, algorithm=algorithm).fit(X)
  results = nbrs.radius_neighbors([[0.0]], return_distance=False)
  assert_equal(results.shape, (1,))
  assert_equal(results.dtype, object)
  assert_array_equal(results[0], [0, 1])

def test_radius_neighbors_boundary_handling ( ) : X = np . array ( [ [ 1.5 ] , [ 3.0 ] , [ 3.01 ] ] ) radius = 3.0 for algorithm in ALGORITHMS : nbrs = neighbors . NearestNeighbors ( radius = radius , algorithm = algorithm ) . fit ( X ) results = nbrs . radius_neighbors ( [ [ 0.0 ] ] , return_distance = False ) assert_equal ( results . shape , ( 1 , ) ) assert_equal ( results . dtype , object ) assert_array_equal ( results [ 0 ] , [ 0 , 1 ] )
test whether points lying on boundary are handled consistently also ensures that even with only one query point .