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

Method test_numpyarithmetic

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

Source from the content-addressed store, hash-verified

2074 [False, True]])
2075
2076 def test_numpyarithmetic(self):
2077 # Check that the mask is not back-propagated when using numpy functions
2078 a = masked_array([-1, 0, 1, 2, 3], mask=[0, 0, 0, 0, 1])
2079 control = masked_array([np.nan, np.nan, 0, np.log(2), -1],
2080 mask=[1, 1, 0, 0, 1])
2081
2082 test = log(a)
2083 assert_equal(test, control)
2084 assert_equal(test.mask, control.mask)
2085 assert_equal(a.mask, [0, 0, 0, 0, 1])
2086
2087 test = np.log(a)
2088 assert_equal(test, control)
2089 assert_equal(test.mask, control.mask)
2090 assert_equal(a.mask, [0, 0, 0, 0, 1])
2091
2092
2093class TestMaskedArrayAttributes:

Callers

nothing calls this directly

Calls 2

assert_equalFunction · 0.90
logFunction · 0.85

Tested by

no test coverage detected