[SciPy-Dev] Bug in KDTree
Fri Dec 10 16:54:45 CST 2010
I came across an issue using KDTree. I searched the bug list, and it
appears that there has already been a patch submitted for review. I have
added comments to the bug report and I think the patch is good to go. I am
not an expert in KDTree myself, but I think the logic is sound.
If the first node of the tree is a leafnode, then query_pairs() will fail if
the points are closer than the distance threshold. This is because the
algorithm is assuming that the first node will always be an innernode. By
rearranging the if-statements so that a check for a leafnode is done first,
you protect against such a situation.
At least, that is my understanding. I welcome comments on this.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the SciPy-Dev