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

Method __array_ufunc__

numpy/ma/tests/test_subclassing.py:170–176  ·  view source on GitHub ↗
(self, ufunc, method, *inputs, **kwargs)

Source from the content-addressed store, hash-verified

168 return np.asarray(self._array)
169
170 def __array_ufunc__(self, ufunc, method, *inputs, **kwargs):
171 if method == '__call__':
172 inputs = [arg._array if isinstance(arg, self.__class__) else arg
173 for arg in inputs]
174 return self.__class__(ufunc(*inputs, **kwargs), **self.attrs)
175 else:
176 return NotImplemented
177
178
179class TestSubclassing:

Callers

nothing calls this directly

Calls 1

ufuncClass · 0.85

Tested by

no test coverage detected