[SciPy-User] Having scipy.ndimage, etc. methods return ndarray subclass instances?
Wed Aug 3 11:37:29 CDT 2011
I'm currently working on creating a subclass of numpy.ndarray, and would
like to ensure that other methods that work with ndarrays (e.g.
http://docs.scipy.org/doc/scipy/reference/ndimage.html) return an instance
of the subclass instead of an ndarray. After reading a discussion on the
topic on Stack Overflow (
looked into adding/modifying __array_finalize__ and __array_wrap__ but
neither of these appear to be called when I call a scipy.ndimage method such
Is there a way I can extend my subclass so that I can ensure that a new
subclass instance or view is returned instead of an ndarray?
Any suggestions would be greatly appreciated.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the SciPy-User