[SciPy-Dev] Enhancements to scipy.spatial.cKDTree

Sturla Molden sturla at molden.no
Mon Jul 16 19:44:21 EDT 2012


Excellent :)

Minor issue:

On line 1750 in ckdtree.pyx, edit dtype from np.int to np.intp. With 
this edit all tests pass on Windows 64.

Sturla



Den 17.07.2012 01:21, skrev Patrick Varilly:
> Ok, I finished cleaning up the other functions that keep track of 
> rectangle-rectangle min/max distances.  The other enhancements with 
> respect to int's and PyArray_DATA are also in (one case where it's not 
> so easy to get rid of PyArray_DATA(arr) is when arr is only defined as 
> an np.ndarray, as it must if it's a class member variable).  I'll 
> attack query_ball_point and perhaps query tomorrow night and do some 
> more general clean-up then as well (e.g., in how Rectangle objects get 
> set up).  I haven't yet looked into the ref-count issue Sturla brought up.
>
> Thanks for all the useful feedback today!
>
> Patrick
>
> On Mon, Jul 16, 2012 at 7:08 PM, Sturla Molden <sturla at molden.no 
> <mailto:sturla at molden.no>> wrote:
>
>     Den 16.07.2012 02:00, skrev Patrick Varilly:
>
>
>         That said, now that the initial effort is complete, it's
>         obvious that a clear pattern recurs in the kd-tree walking
>         algorithms: keeping incremental track of the minimum/maximum
>         distances between two hyperrectangles as they're successively
>         split (alternatively, a hyperrectangle and a point).  If that
>         primitive is abstracted, the code becomes a lot more readable
>         again.
>
>
>     Yes, that was much better :-)
>     +1 for doping it like this (even if there is a small speed penalty).
>
>     We might even do this to the original cKDTree.query function as well.
>
>     Sturla
>
>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scipy-dev/attachments/20120717/443a0c45/attachment.html>


More information about the SciPy-Dev mailing list