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

Method test_testAddSumProd

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

Source from the content-addressed store, hash-verified

247 assert_(eq(min(xr), minimum.reduce(xmr)))
248
249 def test_testAddSumProd(self):
250 # Test add, sum, product.
251 x, y, _, _, _, xm, ym, _, _, _, s = self._create_data()
252 assert_(eq(np.add.reduce(x), add.reduce(x)))
253 assert_(eq(np.add.accumulate(x), add.accumulate(x)))
254 assert_(eq(4, sum(array(4), axis=0)))
255 assert_(eq(4, sum(array(4), axis=0)))
256 assert_(eq(np.sum(x, axis=0), sum(x, axis=0)))
257 assert_(eq(np.sum(filled(xm, 0), axis=0), sum(xm, axis=0)))
258 assert_(eq(np.sum(x, 0), sum(x, 0)))
259 assert_(eq(np.prod(x, axis=0), product(x, axis=0)))
260 assert_(eq(np.prod(x, 0), product(x, 0)))
261 assert_(eq(np.prod(filled(xm, 1), axis=0),
262 product(xm, axis=0)))
263 if len(s) > 1:
264 assert_(eq(np.concatenate((x, y), 1),
265 concatenate((xm, ym), 1)))
266 assert_(eq(np.add.reduce(x, 1), add.reduce(x, 1)))
267 assert_(eq(np.sum(x, 1), sum(x, 1)))
268 assert_(eq(np.prod(x, 1), product(x, 1)))
269
270 def test_testCI(self):
271 # Test of conversions and indexing

Callers

nothing calls this directly

Calls 11

_create_dataMethod · 0.95
assert_Function · 0.90
arrayFunction · 0.90
filledFunction · 0.90
concatenateFunction · 0.90
eqFunction · 0.85
sumFunction · 0.85
accumulateMethod · 0.80
reduceMethod · 0.45
sumMethod · 0.45
prodMethod · 0.45

Tested by

no test coverage detected