[Numpy-discussion] ndarray: subclassing a subclass looses custom attribute

Sebastian Haase seb.haase@gmail....
Fri Oct 1 04:26:33 CDT 2010


Hi,
I'm trying to add a 'meta' attribute to ndarray to keep track of image
data filenames and resolution etc.
Following  the excellent document
http://docs.scipy.org/doc/numpy/user/basics.subclassing.html
this worked right away.

However, I had done this before for some specific image-file-types:
those would add there own attribute to ndarray array (e.g. arr.Mrc)
Now if I call the new  ndarray_meta on my ndarray_with_mrc I loose the
`Mrc` attribute, leaving only the new `meta` attribute.
My code is essentially a verbatim copy of
http://docs.scipy.org/doc/numpy/user/basics.subclassing.html#simple-example-adding-an-extra-attribute-to-ndarray

What can I do ?

Thanks,
Sebastian Haase


More information about the NumPy-Discussion mailing list