[Scipy-tickets] [SciPy] #1373: Bug in KDTree.query_ball_point

SciPy Trac scipy-tickets@scipy....
Thu Jan 27 12:26:19 CST 2011


#1373: Bug in KDTree.query_ball_point
--------------------------+-------------------------------------------------
 Reporter:  schmidtc      |       Owner:  wnbell
     Type:  defect        |      Status:  new   
 Priority:  normal        |   Milestone:  0.9.0 
Component:  scipy.sparse  |     Version:  0.8.0 
 Keywords:                |  
--------------------------+-------------------------------------------------
 There appears to be a bug in KDTree.query_ball_point, when using integer
 points neighbor points that lie on the radius are not always returned.

 Eg, with a 4x4 grid
 >>> import scipy.spatial
 >>> points = [(0, 0), (0, 1), (0, 2), (0, 3), \
 ...              (1, 0), (1, 1), (1, 2), (1, 3), \
 ...              (2, 0), (2, 1), (2, 2), (2, 3), \
 ...              (3, 0), (3, 1), (3, 2), (3, 3)]
 >>> kd=scipy.spatial.KDTree(points)
 >>> kd.query_ball_point((2,0),1)
 [8, 9, 12]


 >>> points = [(0.0, 0.0), (0.0, 1.0), (0.0, 2.0), (0.0, 3.0), \
 ...              (1.0, 0.0), (1.0, 1.0), (1.0, 2.0), (1.0, 3.0), \
 ...              (2.0, 0.0), (2.0, 1.0), (2.0, 2.0), (2.0, 3.0), \
 ...              (3.0, 0.0), (3.0, 1.0), (3.0, 2.0), (3.0, 3.0)]

 >>> kd=scipy.spatial.KDTree(points)
 >>> kd.query_ball_point((2,0),1)
 [4, 8, 9, 12]

-- 
Ticket URL: <http://projects.scipy.org/scipy/ticket/1373>
SciPy <http://www.scipy.org>
SciPy is open-source software for mathematics, science, and engineering.


More information about the Scipy-tickets mailing list