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

Method test_extremum_fill_value

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

Source from the content-addressed store, hash-verified

2295 np.testing.assert_equal(test, control)
2296
2297 def test_extremum_fill_value(self):
2298 # Tests extremum fill values for flexible type.
2299 a = array([(1, (2, 3)), (4, (5, 6))],
2300 dtype=[('A', int), ('B', [('BA', int), ('BB', int)])])
2301 test = a.fill_value
2302 assert_equal(test.dtype, a.dtype)
2303 assert_equal(test['A'], default_fill_value(a['A']))
2304 assert_equal(test['B']['BA'], default_fill_value(a['B']['BA']))
2305 assert_equal(test['B']['BB'], default_fill_value(a['B']['BB']))
2306
2307 test = minimum_fill_value(a)
2308 assert_equal(test.dtype, a.dtype)
2309 assert_equal(test[0], minimum_fill_value(a['A']))
2310 assert_equal(test[1][0], minimum_fill_value(a['B']['BA']))
2311 assert_equal(test[1][1], minimum_fill_value(a['B']['BB']))
2312 assert_equal(test[1], minimum_fill_value(a['B']))
2313
2314 test = maximum_fill_value(a)
2315 assert_equal(test.dtype, a.dtype)
2316 assert_equal(test[0], maximum_fill_value(a['A']))
2317 assert_equal(test[1][0], maximum_fill_value(a['B']['BA']))
2318 assert_equal(test[1][1], maximum_fill_value(a['B']['BB']))
2319 assert_equal(test[1], maximum_fill_value(a['B']))
2320
2321 def test_extremum_fill_value_subdtype(self):
2322 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