[SciPy-Dev] removing pure python KDTree implementation
Sturla Molden
sturla.molden at gmail.com
Sun Feb 21 08:41:56 EST 2016
Ralf Gommers <ralf.gommers at gmail.com> wrote:
> Hi all,
>
> For a long time we've had both a Python (KDTree) and a Cython/C++ (cKDTree)
> version of a k-d tree structure in scipy.spatial. The cKDTree version
> reached feature-parity with KDTree in 0.12.0, and new features are being
> added regularly now. So keeping the orders of magnitude slower pure Python
> version seems to be a bit pointless - only adds to a maintenance burden and
> to giving users an unnecessary choice to make.
>
> So proposal: remove the pure Python code and make KDTree an alias for
> cKDTree. This can be done straight away.
>
> For the future it may also be desirable to get rid of the duplicate name.
> The issue then is which one to keep. KDTree is nicer, but it would require
> users who have picked the fast version now to change their code. So maybe
> just deprecate one in documentation, but keep both names working?
What about this?
1. make KDTree an alias for cKDTree
2. make KDTreeNode an alias for cKDTreeNode
3. keep all names working
4. only have KDTree and KDTreeNode in the documentation
5. keep kdtree.py for the test suite, but do not export its contents
Sturla
More information about the SciPy-Dev
mailing list