MCPcopy Create free account
hub / github.com/numpy/numpy / wrapped_method

Function wrapped_method

numpy/ma/core.py:2571–2581  ·  view source on GitHub ↗
(self, *args, **params)

Source from the content-addressed store, hash-verified

2569
2570 """
2571 def wrapped_method(self, *args, **params):
2572 result = getattr(self._data, funcname)(*args, **params)
2573 result = result.view(type(self))
2574 result._update_from(self)
2575 mask = self._mask
2576 if not onmask:
2577 result.__setmask__(mask)
2578 elif mask is not nomask:
2579 # __setmask__ makes a copy, which we don't want
2580 result._mask = getattr(mask, funcname)(*args, **params)
2581 return result
2582 methdoc = getattr(ndarray, funcname, None) or getattr(np, funcname, None)
2583 if methdoc is not None:
2584 wrapped_method.__doc__ = methdoc.__doc__

Callers

nothing calls this directly

Calls 3

_update_fromMethod · 0.80
__setmask__Method · 0.80
viewMethod · 0.45

Tested by

no test coverage detected