[Numpy-discussion] Proposal: scipy.spatial

Nathan Bell wnbell@gmail....
Wed Oct 1 01:10:13 CDT 2008


On Wed, Oct 1, 2008 at 1:26 AM, Gael Varoquaux
<gael.varoquaux@normalesup.org> wrote:
>
> Absolutely. I just think k should default to None, when
> distance_upper_bound is specified. k=None could be interpreted as k=1
> when distance_uppper_bound is not specified.
>

Why not expose the various possibilities through different names?

# nearest k points (possibly fewer)
query_nearest(pt, k=1)

# all points within given distance
query_sphere(pt, distance)

#nearest k points within given distance (possibly fewer)
query(pt, k, distance)

Few people will use the last form, but it's useful nevertheless.

-- 
Nathan Bell wnbell@gmail.com
http://graphics.cs.uiuc.edu/~wnbell/


More information about the Numpy-discussion mailing list