You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would expect to get [(5, 3), (7, 3)] as the result, but I get [(5, 3), (2, 3)].
The solution seems to be that in line 70 instead of dx * dx < -heap[0][0] it should be <= for going into the second branch (or to make sure it works well with floats: dx * dx < -heap[0][0] + 1e-6).
With this change I get the expected result.
The text was updated successfully, but these errors were encountered:
Hi, there seems to be a bug when points share the same coordinates. See the following example:
tree = KDTree([(7, 3), (5, 3), (2, 3)], 2)
print(tree.get_knn((5, 3), 2, False))
I would expect to get [(5, 3), (7, 3)] as the result, but I get [(5, 3), (2, 3)].
The solution seems to be that in line 70 instead of dx * dx < -heap[0][0] it should be <= for going into the second branch (or to make sure it works well with floats: dx * dx < -heap[0][0] + 1e-6).
With this change I get the expected result.
The text was updated successfully, but these errors were encountered: