[Numpy-discussion] more on MA not pickling

Tim Churches tchur at optushome.com.au
Tue Apr 17 17:04:28 EDT 2001

Tavis Rudd wrote:
> Hi,
> I posted something about this a few weeks ago, but got
> distracted before I had a chance to look into it further
> ...
> Revisions 1.5 and up of activeattr.py in the MA package
> cause a fatal error when pickling is attempted. The pickle
> and cPickle modules don't allow unbound instance methods to
> be pickled and the ActiveAttributes mixin is storing
> attribute handlers, such as ActiveAttribute.basic_get, as
> unbound instance methods.
> Revision 1.4 works fine if basic_get is modified so that
> an AttributeError is raised instead of a KeyError when an
> attribute is not found.
> This bug was introduced in an attempt to allow child
> classes of MA to be able to modify activeattributes. I
> suggest reverting back to rev 1.4 of activeattr with a
> modified basic_get method and forgetting about allowing
> child classes to do this.

Can I add my voice to Tavis' suggestion? The ability to cPickle MA
arrays is absolutely essential. In the health sciences, where some data
are **always** missing, MA is a godsend, but it needs to be able to be
made a persistent godsend.


Tim C

More information about the NumPy-Discussion mailing list