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

Method test_testBasic2d

numpy/ma/tests/test_old_ma.py:130–147  ·  view source on GitHub ↗
(self, s)

Source from the content-addressed store, hash-verified

128
129 @pytest.mark.parametrize("s", [(4, 3), (6, 2)])
130 def test_testBasic2d(self, s):
131 # Test of basic array creation and properties in 2 dimensions.
132 x, y, _, m1, _, xm, ym, _, _, xf, s = self._create_data()
133 x = x.reshape(s)
134 y = y.reshape(s)
135 xm = xm.reshape(s)
136 ym = ym.reshape(s)
137 xf = xf.reshape(s)
138
139 assert_(not isMaskedArray(x))
140 assert_(isMaskedArray(xm))
141 assert_equal(shape(xm), s)
142 assert_equal(xm.shape, s)
143 assert_equal(xm.size, reduce(lambda x, y: x * y, s))
144 assert_equal(count(xm), len(m1) - reduce(lambda x, y: x + y, m1))
145 assert_(eq(xm, xf))
146 assert_(eq(filled(xm, 1.e20), xf))
147 assert_(eq(x, xm))
148
149 def test_testArithmetic(self):
150 # Test of basic arithmetic.

Callers

nothing calls this directly

Calls 9

_create_dataMethod · 0.95
assert_Function · 0.90
isMaskedArrayFunction · 0.90
assert_equalFunction · 0.90
shapeFunction · 0.90
filledFunction · 0.90
countFunction · 0.85
eqFunction · 0.85
reshapeMethod · 0.80

Tested by

no test coverage detected