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

Method test_basic1d

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

Source from the content-addressed store, hash-verified

106 assert_(x.filled().dtype is x._data.dtype)
107
108 def test_basic1d(self):
109 # Test of basic array creation and properties in 1 dimension.
110 (x, y, a10, m1, m2, xm, ym, z, zm, xf) = self.d
111 assert_(not isMaskedArray(x))
112 assert_(isMaskedArray(xm))
113 assert_((xm - ym).filled(0).any())
114 fail_if_equal(xm.mask.astype(int), ym.mask.astype(int))
115 s = x.shape
116 assert_equal(np.shape(xm), s)
117 assert_equal(xm.shape, s)
118 assert_equal(xm.dtype, x.dtype)
119 assert_equal(zm.dtype, z.dtype)
120 assert_equal(xm.size, reduce(lambda x, y:x * y, s))
121 assert_equal(count(xm), len(m1) - reduce(lambda x, y:x + y, m1))
122 assert_array_equal(xm, xf)
123 assert_array_equal(filled(xm, 1.e20), xf)
124 assert_array_equal(x, xm)
125
126 def test_basic2d(self):
127 # Test of basic array creation and properties in 2 dimensions.

Callers

nothing calls this directly

Calls 11

isMaskedArrayFunction · 0.90
fail_if_equalFunction · 0.90
assert_equalFunction · 0.90
countFunction · 0.90
assert_array_equalFunction · 0.90
filledFunction · 0.90
astypeMethod · 0.80
assert_Function · 0.50
anyMethod · 0.45
filledMethod · 0.45
shapeMethod · 0.45

Tested by

no test coverage detected