+ def __reduce__(self):
+ """Collapse an instance for pickling.
+
+ Returns
+ -------
+ reconstruct : callable
+ Called to create the initial version of the object.
+ args : tuple
+ A tuple of arguments for `reconstruct`
+ state : (optional)
+ The state to be passed to __setstate__, if present.
+ iter : iterator (optional)
+ Yielded items will be appended to the reconstructed
+ object.
+ dict : iterator (optional)
+ Yielded (key,value) tuples pushed back onto the
+ reconstructed object.
+ """
+ base_reduce = list(numpy.ndarray.__reduce__(self))
+ # tack our stuff onto ndarray's setstate portion.
+ base_reduce[2] = (base_reduce[2], (self.info,))
+ return tuple(base_reduce)
+
+ def __setstate__(self, state):
+ base_class_state,own_state = state
+ numpy.ndarray.__setstate__(self, base_class_state)
+ self.info, = own_state
+