[SciPy-dev] Ball Tree class

Robert Kern robert.kern at gmail.com
Thu Oct 29 18:10:42 EDT 2009


On Thu, Oct 29, 2009 at 17:01, Jake VanderPlas <jakevdp at gmail.com> wrote:
> Hello,
> I've been using scipy.spatial.KDTree for my research, and found it
> very useful.  Recently, though, my datasets have been getting larger -
> upwards of 10,000 points in 1000-2000 dimensions.
> The KDTree starts getting slow with such a
> large dimensionality.  I've addressed this by writing a C++ Ball Tree
> code, and wrapping it using swig and numpy.i.  I've been wanting to
> begin contributing to the scipy project, and I think this would be a
> great place to start.  I'd like to begin the process of adding
> this to the scipy.spatial package.

That would be fantastic!

> A few questions: Is it preferable to have an
> implementation in C rather than C++?

I'd rather have well designed code and using a language that is
appropriate for the design. I suspect either one will be okay for your
task.

> Cython, swig, or hand-wrapped code?
> cKDTree is written in Cython, with C.  Should I stick to that
> convention to maintain uniformity in the scipy.spatial package?

I try to avoid SWIG these days for my usual wrapping tasks. I do
recommend trying out Cython.

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless
enigma that is made terrible by our own mad attempt to interpret it as
though it had an underlying truth."
  -- Umberto Eco



More information about the SciPy-Dev mailing list