MCPcopy
hub / github.com/numpy/numpy / _update_from

Method _update_from

numpy/ma/core.py:3025–3048  ·  view source on GitHub ↗

Copies some attributes of obj to self.

(self, obj)

Source from the content-addressed store, hash-verified

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 """

Callers 15

__array_finalize__Method · 0.95
__call__Method · 0.80
__call__Method · 0.80
__call__Method · 0.80
wrapped_methodFunction · 0.80
__array_wrap__Method · 0.80
__getitem__Method · 0.80
compressMethod · 0.80
_comparisonMethod · 0.80
ravelMethod · 0.80
reshapeMethod · 0.80
varMethod · 0.80

Calls 1

updateMethod · 0.80

Tested by

no test coverage detected