Copies some attributes of obj to self.
(self, obj)
| 2950 | |
| 2951 | |
| 2952 | def _update_from(self, obj): |
| 2953 | """ |
| 2954 | Copies some attributes of obj to self. |
| 2955 | |
| 2956 | """ |
| 2957 | if isinstance(obj, ndarray): |
| 2958 | _baseclass = type(obj) |
| 2959 | else: |
| 2960 | _baseclass = ndarray |
| 2961 | # We need to copy the _basedict to avoid backward propagation |
| 2962 | _optinfo = {} |
| 2963 | _optinfo.update(getattr(obj, '_optinfo', {})) |
| 2964 | _optinfo.update(getattr(obj, '_basedict', {})) |
| 2965 | if not isinstance(obj, MaskedArray): |
| 2966 | _optinfo.update(getattr(obj, '__dict__', {})) |
| 2967 | _dict = dict(_fill_value=getattr(obj, '_fill_value', None), |
| 2968 | _hardmask=getattr(obj, '_hardmask', False), |
| 2969 | _sharedmask=getattr(obj, '_sharedmask', False), |
| 2970 | _isfield=getattr(obj, '_isfield', False), |
| 2971 | _baseclass=getattr(obj, '_baseclass', _baseclass), |
| 2972 | _optinfo=_optinfo, |
| 2973 | _basedict=_optinfo) |
| 2974 | self.__dict__.update(_dict) |
| 2975 | self.__dict__.update(_optinfo) |
| 2976 | return |
| 2977 | |
| 2978 | def __array_finalize__(self, obj): |
| 2979 | """ |
no test coverage detected