MCPcopy Index your code
hub / github.com/numpy/numpy / __setstate__

Method __setstate__

numpy/ma/core.py:6492–6507  ·  view source on GitHub ↗

Restore the internal state of the masked array, for pickling purposes. ``state`` is typically the output of the ``__getstate__`` output, and is a 5-tuple: - class name - a tuple giving the shape of the data - a typecode for the data - a binary string

(self, state)

Source from the content-addressed store, hash-verified

6490 return data_state + (getmaskarray(self).tobytes(cf), self._fill_value)
6491
6492 def __setstate__(self, state):
6493 """Restore the internal state of the masked array, for
6494 pickling purposes. ``state`` is typically the output of the
6495 ``__getstate__`` output, and is a 5-tuple:
6496
6497 - class name
6498 - a tuple giving the shape of the data
6499 - a typecode for the data
6500 - a binary string for the data
6501 - a binary string for the mask.
6502
6503 """
6504 (_, shp, typ, isf, raw, msk, flv) = state
6505 super().__setstate__((shp, typ, isf, raw))
6506 self._mask.__setstate__((shp, make_mask_descr(typ), isf, msk))
6507 self.fill_value = flv
6508
6509 def __reduce__(self):
6510 """Return a 3-tuple for pickling a MaskedArray.

Callers 4

test_state_settingMethod · 0.45
test_mutateMethod · 0.45
random.pyFile · 0.45

Calls 1

make_mask_descrFunction · 0.85

Tested by 3

test_state_settingMethod · 0.36
test_mutateMethod · 0.36