MCPcopy Index your code
hub / github.com/numpy/numpy / test_trace_subclass

Method test_trace_subclass

numpy/_core/tests/test_multiarray.py:4027–4035  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

4025 assert ret is out
4026
4027 def test_trace_subclass(self):
4028 # The class would need to overwrite trace to ensure single-element
4029 # output also has the right subclass.
4030 class MyArray(np.ndarray):
4031 pass
4032
4033 b = np.arange(8).reshape((2, 2, 2)).view(MyArray)
4034 t = b.trace()
4035 assert_(isinstance(t, MyArray))
4036
4037 def test_put(self):
4038 icodes = np.typecodes['AllInteger']

Callers

nothing calls this directly

Calls 4

assert_Function · 0.90
reshapeMethod · 0.80
traceMethod · 0.80
viewMethod · 0.45

Tested by

no test coverage detected