Copies some attributes of obj to self.
(self, obj)
| 3023 | return _data |
| 3024 | |
| 3025 | def _update_from(self, obj): |
| 3026 | """ |
| 3027 | Copies some attributes of obj to self. |
| 3028 | |
| 3029 | """ |
| 3030 | if isinstance(obj, ndarray): |
| 3031 | _baseclass = type(obj) |
| 3032 | else: |
| 3033 | _baseclass = ndarray |
| 3034 | # We need to copy the _basedict to avoid backward propagation |
| 3035 | _optinfo = {} |
| 3036 | _optinfo.update(getattr(obj, '_optinfo', {})) |
| 3037 | _optinfo.update(getattr(obj, '_basedict', {})) |
| 3038 | if not isinstance(obj, MaskedArray): |
| 3039 | _optinfo.update(getattr(obj, '__dict__', {})) |
| 3040 | _dict = {'_fill_value': getattr(obj, '_fill_value', None), |
| 3041 | '_hardmask': getattr(obj, '_hardmask', False), |
| 3042 | '_sharedmask': getattr(obj, '_sharedmask', False), |
| 3043 | '_isfield': getattr(obj, '_isfield', False), |
| 3044 | '_baseclass': getattr(obj, '_baseclass', _baseclass), |
| 3045 | '_optinfo': _optinfo, |
| 3046 | '_basedict': _optinfo} |
| 3047 | self.__dict__.update(_dict) |
| 3048 | self.__dict__.update(_optinfo) |
| 3049 | |
| 3050 | def __array_finalize__(self, obj): |
| 3051 | """ |
no test coverage detected