[SciPy-dev] Should ndimage.measurements.* should return lists if index is a list?

josef.pktd at gmail.com josef.pktd at gmail.com
Mon Apr 20 00:03:22 EDT 2009


On Sun, Apr 19, 2009 at 9:59 PM, David Cournapeau <cournape at gmail.com>wrote:

> 2009/4/20 Stéfan van der Walt <stefan at sun.ac.za>:
>
> >
> > With Cython, a type conversion is trivial to do  Ndimage was based on
> > Numeric -- but with NumPy many of its operations can be done using
> > fancy indexing and broadcasting.  A slight decrease in speed for a
> > massive improvement in readability.
>
> Having a fast code which crashes and that nobody can maintain is not
> that useful anyway :)
>

ndimage has a very good test suite, and as long as correct numbers are given
to ndimage, I think it works very well.  I only use measurements and
correlate. Measurement is the fastest we have to get statistics by labels
and looks useful for stats.

ndimage doesn't look very robust to being given wrong types or numbers,
instead of exceptions we get segfaults. 4 out of 7 tickets are on crashes
with incorrect numbers, 1 ticket (824) could be closed. The missing type
checks or type conversions that cause the crash in this example could be
also be handled on the python side. Ticket 295 is missing a check for an
invalid bound (origin) and crashes.
I'm very glad if someone makes some incremental improvement to the existing
(interface) code as discussed in this thread.

There are not many complaints/tickets about the code itself, no wrong
"images", in contrast to other subpackages of scipy.

But of course, I'm not the one chasing platform specific problems in c code.

Josef
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scipy-dev/attachments/20090420/ec265e2b/attachment.html>


More information about the SciPy-Dev mailing list