Sets only the blob field still validating the existing dtype
(self, blob, throw_on_type_mismatch=False, unsafe=False)
| 785 | "fields but got {}".format(self.dtype) |
| 786 | |
| 787 | def set_value(self, blob, throw_on_type_mismatch=False, unsafe=False): |
| 788 | """Sets only the blob field still validating the existing dtype""" |
| 789 | if self.dtype.base != np.void and throw_on_type_mismatch: |
| 790 | assert isinstance(blob, np.ndarray), "Got {!r}".format(blob) |
| 791 | assert blob.dtype.base == self.dtype.base, ( |
| 792 | "Expected {}, got {}".format(self.dtype.base, blob.dtype.base)) |
| 793 | self.set(dtype=self._original_dtype, blob=blob, unsafe=unsafe) |
| 794 | |
| 795 | def set(self, dtype=None, blob=None, metadata=None, unsafe=False): |
| 796 | """Set the type and/or blob of this scalar. See __init__ for details. |
no test coverage detected