[SciPy-dev] Should ndimage.measurements.* should return lists if index is a list?
Stéfan van der Walt
Fri May 1 12:21:13 CDT 2009
2009/5/1 Thouis (Ray) Jones <email@example.com>:
> 2009/4/19 Stéfan van der Walt <firstname.lastname@example.org>:
> We may have a student this summer that can work on it as a project.
Fantastic, that'd be wonderful.
> In the meantime, I rewrote ndimage.measurements in pure python/numpy.
What a great patch!
For the record, here are the git instructions to view the patch:
git fetch http://broad.mit.edu/~thouis/scipy.git ndimage_measurements_rewrite
git log -p ..FETCH_HEAD
> Everything goes through a single labeled_reduce function, which
> handles all the label/index interactions without needing any type
Looks like _labeled_reduce and _labeled_reduce2 can possibly be
combined, saving some duplication. I see there is also a
labeled_reduce, but I haven't looked at that in too much detail.
I think this piece of code proves that it is well worth converting
ndimage to Python/Cython. The code is *much* more readable, which
means better code review, more bug fixes, and happier maintainers.
Thanks for your effort, Ray!
More information about the Scipy-dev