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

Method test_flatnotmasked_contiguous

numpy/ma/tests/test_extras.py:147–163  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

145 self.check_clump(clump_unmasked)
146
147 def test_flatnotmasked_contiguous(self):
148 # Test flatnotmasked_contiguous
149 a = arange(10)
150 # No mask
151 test = flatnotmasked_contiguous(a)
152 assert_equal(test, [slice(0, a.size)])
153 # mask of all false
154 a.mask = np.zeros(10, dtype=bool)
155 assert_equal(test, [slice(0, a.size)])
156 # Some mask
157 a[(a < 3) | (a > 8) | (a == 5)] = masked
158 test = flatnotmasked_contiguous(a)
159 assert_equal(test, [slice(3, 5), slice(6, 9)])
160 #
161 a[:] = masked
162 test = flatnotmasked_contiguous(a)
163 assert_equal(test, [])
164
165
166class TestAverage:

Callers

nothing calls this directly

Calls 3

flatnotmasked_contiguousFunction · 0.90
assert_equalFunction · 0.90
arangeFunction · 0.85

Tested by

no test coverage detected