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

Method test_extremum_fill_value

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

Source from the content-addressed store, hash-verified

2491 np.testing.assert_equal(test, control)
2492
2493 def test_extremum_fill_value(self):
2494 # Tests extremum fill values for flexible type.
2495 a = array([(1, (2, 3)), (4, (5, 6))],
2496 dtype=[('A', int), ('B', [('BA', int), ('BB', int)])])
2497 test = a.fill_value
2498 assert_equal(test.dtype, a.dtype)
2499 assert_equal(test['A'], default_fill_value(a['A']))
2500 assert_equal(test['B']['BA'], default_fill_value(a['B']['BA']))
2501 assert_equal(test['B']['BB'], default_fill_value(a['B']['BB']))
2502
2503 test = minimum_fill_value(a)
2504 assert_equal(test.dtype, a.dtype)
2505 assert_equal(test[0], minimum_fill_value(a['A']))
2506 assert_equal(test[1][0], minimum_fill_value(a['B']['BA']))
2507 assert_equal(test[1][1], minimum_fill_value(a['B']['BB']))
2508 assert_equal(test[1], minimum_fill_value(a['B']))
2509
2510 test = maximum_fill_value(a)
2511 assert_equal(test.dtype, a.dtype)
2512 assert_equal(test[0], maximum_fill_value(a['A']))
2513 assert_equal(test[1][0], maximum_fill_value(a['B']['BA']))
2514 assert_equal(test[1][1], maximum_fill_value(a['B']['BB']))
2515 assert_equal(test[1], maximum_fill_value(a['B']))
2516
2517 def test_extremum_fill_value_subdtype(self):
2518 a = array(([2, 3, 4],), dtype=[('value', np.int8, 3)])

Callers

nothing calls this directly

Calls 5

arrayFunction · 0.90
assert_equalFunction · 0.90
default_fill_valueFunction · 0.90
minimum_fill_valueFunction · 0.90
maximum_fill_valueFunction · 0.90

Tested by

no test coverage detected