failed unittest in py-kdtree_test.py
Paul Harris
paulharris at computer.org
Sun Dec 6 04:43:35 UTC 2009
2009/12/6 Jason Remillard <remillard.jason at gmail.com>
> Hi,
>
> I am one of the users that has been caught by the find_within_range
> functions :-)
>
>
Hi Jason,
> Breaking peoples code is kind of drastic. A simple comment above each
> find functions would have prevented any confusion on my part.
>
>
True. My biggest concern is the welfare of those programmers who have been
caught but are unaware. A comment will save future users from harm, but not
the current users.
I find the biggest confusion is that you can do
find_within_range(point,distance)
which converts it into
find_within_range( box_shaped_region )
The point-distance function is deceptive, with or without a comment. That
is what I was hoping to kill off.
Like you said, maybe we just need to add comments, better documentation, and
a big "warning" on the webpage and ChangeLog or something like that. If a
developer upgrades without checking what changes were made, then ... their
loss I guess.
Just add in the new functions (I assume they look something like this)
>
> find_within_range_abs
>
I don't understand what this function would do... ?
Any distance measurement must be absolute, no? Unless you are searching
based on a point+direction (ie a vector) or something funky like that.
find_within_range_manhattan
> find_within_range_euclidean
>
>
These I understand, and I like the naming (although "manhattan" is known by
many names like "taxi distance" or "city block" etc etc).
> Just leave find_within_range in place, and have it be a simple one
> line function calling one of the new functions. It is pretty much
> impossible to use the class without looking in the header file, so it
> will be crystal clear to everybody what is going on when using the new
> release. Now if the plan is to not support abs distance, then you
> should kill the function rather than changing the systematics.
>
>
thanks for your comments :)
Paul
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/libkdtree-devel/attachments/20091206/d88f9c9c/attachment.htm>
More information about the libkdtree-devel
mailing list