def __reduce__(self): """Necessary for making this object picklable""" object_state = list(ndarray.__reduce__(self)) subclass_state = (self.index, self.fill_value, self.sp_index, self.name) object_state[2] = (object_state[2], subclass_state) return tuple(object_state)
def __reduce__(self): """Necessary for making this object picklable""" object_state = list(ndarray.__reduce__(self)) saved_attr = ['frame_no', 'metadata'] subclass_state = {a: getattr(self, a) for a in saved_attr} object_state[2] = (object_state[2], subclass_state) return tuple(object_state)
def __reduce__(self): """Necessary for making this object picklable""" print("__reduce__") object_state = list(ndarray.__reduce__(self)) saved_attr = chain(_axis_attrs, _array_attrs) subclass_state = {a: getattr(self, a) for a in saved_attr} object_state[2] = (object_state[2], subclass_state) return tuple(object_state)