[Numpy-discussion] Ready for review: PyArrayNeighIterObject, an iterator to iterate over a neighborhood in arbitrary arrays

Charles R Harris charlesr.harris at gmail.com
Sat Jun 13 14:59:11 EDT 2009


On Sat, Jun 13, 2009 at 12:29 PM, David Cournapeau <cournape at gmail.com>wrote:

> On Sun, Jun 14, 2009 at 3:00 AM, Charles R
> Harris<charlesr.harris at gmail.com> wrote:
> >
> >
> > On Sat, Jun 13, 2009 at 7:46 AM, David Cournapeau
> > <david at ar.media.kyoto-u.ac.jp> wrote:
> >>
> >> Hi,
> >>
> >>    I have cleaned up a bit the code, and would like to suggest the
> >> inclusion of a neighborhood iterator for numpy. Stéfan took a look at it
> >> already, but it needs more eyeballs. It is a "subclass" of
> >> PyArrayIterObject, and can be used to iterate over a neighborhood of a
> >> point (handling boundaries with 0 padding for the time being).
> >>
> >> http://codereview.appspot.com/75055/show
> >>
> >> I have used it to replace the current for code correlateND in
> >> scipy.signal, where it works quite well (I think it makes the code more
> >> readable in that case).
> >
> > Some nitpicks:
> >
> > 1) The name neigh sounds like a horse. Maybe region,  neighborhood, or
> > something similar would be better.
>
> Neighborhood makes the name quite long - maybe region would be better,
> although region does not imply the notion of "contiguity" ?
>

It does make it long, which is an inconvenience to the coder. But I think it
is easier on the reader. Hmm... a thesaurus also suggests zone, area, and
vicinity.

Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20090613/e88ee1fc/attachment.html>


More information about the NumPy-Discussion mailing list