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

Method test_basic1d

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

Source from the content-addressed store, hash-verified

196 assert_(x.filled().dtype is x._data.dtype)
197
198 def test_basic1d(self):
199 # Test of basic array creation and properties in 1 dimension.
200 x, _, _, m1, _, xm, ym, z, zm, xf = self._create_data()
201 assert_(not isMaskedArray(x))
202 assert_(isMaskedArray(xm))
203 assert_((xm - ym).filled(0).any())
204 fail_if_equal(xm.mask.astype(int), ym.mask.astype(int))
205 s = x.shape
206 assert_equal(np.shape(xm), s)
207 assert_equal(xm.shape, s)
208 assert_equal(xm.dtype, x.dtype)
209 assert_equal(zm.dtype, z.dtype)
210 assert_equal(xm.size, reduce(lambda x, y: x * y, s))
211 assert_equal(count(xm), len(m1) - reduce(lambda x, y: x + y, m1))
212 assert_array_equal(xm, xf)
213 assert_array_equal(filled(xm, 1.e20), xf)
214 assert_array_equal(x, xm)
215
216 def test_basic2d(self):
217 # Test of basic array creation and properties in 2 dimensions.

Callers

nothing calls this directly

Calls 12

_create_dataMethod · 0.95
isMaskedArrayFunction · 0.90
fail_if_equalFunction · 0.90
assert_equalFunction · 0.90
countFunction · 0.90
assert_array_equalFunction · 0.90
filledFunction · 0.90
assert_Function · 0.85
astypeMethod · 0.80
anyMethod · 0.45
filledMethod · 0.45
shapeMethod · 0.45

Tested by

no test coverage detected