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

Patrick Varilly patvarilly@gmail....
Thu Jul 19 19:48:04 CDT 2012


Dear all,

I've finished cleaning up the cKDTree code, which should now be much more
readable and maintainable than before.  It's ready for a final review from
top to bottom.  I'm going on holidays for two weeks starting tomorrow, but
look forward to any comments when I come back.

All the best,

Patrick

On Tue, Jul 17, 2012 at 9:22 AM, Patrick Varilly <patvarilly@gmail.com>wrote:

> Brilliant!  Done,
>
> Patrick
>
>
> On Tue, Jul 17, 2012 at 12:44 AM, Sturla Molden <sturla@molden.no> wrote:
>
>>  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@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.scipy.org/pipermail/scipy-dev/attachments/20120720/ec7b6d75/attachment.html 


More information about the SciPy-Dev mailing list