[Numpy-discussion] Proposal: scipy.spatial

Nathan Bell wnbell at gmail.com
Wed Oct 1 02:10:13 EDT 2008


On Wed, Oct 1, 2008 at 1:26 AM, Gael Varoquaux
<gael.varoquaux at 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 at gmail.com
http://graphics.cs.uiuc.edu/~wnbell/



More information about the NumPy-Discussion mailing list