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

Method test_trace

numpy/ma/tests/test_old_ma.py:869–875  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

867 return x, X, XX, m, mx, mX, mXX
868
869 def test_trace(self):
870 _, X, _, _, _, mX, _ = self._create_data()
871 mXdiag = mX.diagonal()
872 assert_equal(mX.trace(), mX.diagonal().compressed().sum())
873 assert_(eq(mX.trace(),
874 X.trace() - sum(mXdiag.mask * X.diagonal(),
875 axis=0)))
876
877 def test_clip(self):
878 x, _, _, _, mx, _, _ = self._create_data()

Callers

nothing calls this directly

Calls 8

_create_dataMethod · 0.95
assert_equalFunction · 0.90
assert_Function · 0.90
eqFunction · 0.85
sumFunction · 0.85
traceMethod · 0.80
sumMethod · 0.45
compressedMethod · 0.45

Tested by

no test coverage detected