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

Method test_minmax_methods

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

Source from the content-addressed store, hash-verified

1281 assert_(result is nout)
1282
1283 def test_minmax_methods(self):
1284 # Additional tests on max/min
1285 (_, _, _, _, _, xm, _, _, _, _) = self.d
1286 xm.shape = (xm.size,)
1287 assert_equal(xm.max(), 10)
1288 assert_(xm[0].max() is masked)
1289 assert_(xm[0].max(0) is masked)
1290 assert_(xm[0].max(-1) is masked)
1291 assert_equal(xm.min(), -10.)
1292 assert_(xm[0].min() is masked)
1293 assert_(xm[0].min(0) is masked)
1294 assert_(xm[0].min(-1) is masked)
1295 assert_equal(xm.ptp(), 20.)
1296 assert_(xm[0].ptp() is masked)
1297 assert_(xm[0].ptp(0) is masked)
1298 assert_(xm[0].ptp(-1) is masked)
1299
1300 x = array([1, 2, 3], mask=True)
1301 assert_(x.min() is masked)
1302 assert_(x.max() is masked)
1303 assert_(x.ptp() is masked)
1304
1305 def test_minmax_dtypes(self):
1306 # Additional tests on max/min for non-standard float and complex dtypes

Callers

nothing calls this directly

Calls 6

assert_equalFunction · 0.90
arrayFunction · 0.90
assert_Function · 0.50
maxMethod · 0.45
minMethod · 0.45
ptpMethod · 0.45

Tested by

no test coverage detected