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

Function consistent_subclass

numpy/linalg/tests/test_linalg.py:33–37  ·  view source on GitHub ↗
(out, in_)

Source from the content-addressed store, hash-verified

31
32
33def consistent_subclass(out, in_):
34 # For ndarray subclass input, our output should have the same subclass
35 # (non-ndarray input gets converted to ndarray).
36 return type(out) is (type(in_) if isinstance(in_, np.ndarray)
37 else np.ndarray)
38
39
40old_assert_almost_equal = assert_almost_equal

Callers 8

doMethod · 0.85
doMethod · 0.85
doMethod · 0.85
doMethod · 0.85
doMethod · 0.85
doMethod · 0.85
doMethod · 0.85
doMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected