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

Method test_testBasic2d

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

Source from the content-addressed store, hash-verified

66
67 @pytest.mark.parametrize("s", [(4, 3), (6, 2)])
68 def test_testBasic2d(self, s):
69 # Test of basic array creation and properties in 2 dimensions.
70 (x, y, a10, m1, m2, xm, ym, z, zm, xf, s) = self.d
71 x.shape = s
72 y.shape = s
73 xm.shape = s
74 ym.shape = s
75 xf.shape = s
76
77 assert_(not isMaskedArray(x))
78 assert_(isMaskedArray(xm))
79 assert_equal(shape(xm), s)
80 assert_equal(xm.shape, s)
81 assert_equal(xm.size, reduce(lambda x, y: x * y, s))
82 assert_equal(count(xm), len(m1) - reduce(lambda x, y: x + y, m1))
83 assert_(eq(xm, xf))
84 assert_(eq(filled(xm, 1.e20), xf))
85 assert_(eq(x, xm))
86
87 def test_testArithmetic(self):
88 # Test of basic arithmetic.

Callers

nothing calls this directly

Calls 7

assert_Function · 0.90
isMaskedArrayFunction · 0.90
assert_equalFunction · 0.90
shapeFunction · 0.90
filledFunction · 0.90
countFunction · 0.85
eqFunction · 0.85

Tested by

no test coverage detected