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

Method test_minmax_methods

numpy/ma/tests/test_core.py:1403–1423  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1401 assert_(result is nout)
1402
1403 def test_minmax_methods(self):
1404 # Additional tests on max/min
1405 xm = self._create_data()[5]
1406 xm = xm.reshape((xm.size,))
1407 assert_equal(xm.max(), 10)
1408 assert_(xm[0].max() is masked)
1409 assert_(xm[0].max(0) is masked)
1410 assert_(xm[0].max(-1) is masked)
1411 assert_equal(xm.min(), -10.)
1412 assert_(xm[0].min() is masked)
1413 assert_(xm[0].min(0) is masked)
1414 assert_(xm[0].min(-1) is masked)
1415 assert_equal(xm.ptp(), 20.)
1416 assert_(xm[0].ptp() is masked)
1417 assert_(xm[0].ptp(0) is masked)
1418 assert_(xm[0].ptp(-1) is masked)
1419
1420 x = array([1, 2, 3], mask=True)
1421 assert_(x.min() is masked)
1422 assert_(x.max() is masked)
1423 assert_(x.ptp() is masked)
1424
1425 def test_minmax_dtypes(self):
1426 # Additional tests on max/min for non-standard float and complex dtypes

Callers

nothing calls this directly

Calls 8

_create_dataMethod · 0.95
assert_equalFunction · 0.90
arrayFunction · 0.90
assert_Function · 0.85
reshapeMethod · 0.80
maxMethod · 0.45
minMethod · 0.45
ptpMethod · 0.45

Tested by

no test coverage detected