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

Method test_basic2d

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

Source from the content-addressed store, hash-verified

124 assert_array_equal(x, xm)
125
126 def test_basic2d(self):
127 # Test of basic array creation and properties in 2 dimensions.
128 (x, y, a10, m1, m2, xm, ym, z, zm, xf) = self.d
129 for s in [(4, 3), (6, 2)]:
130 x.shape = s
131 y.shape = s
132 xm.shape = s
133 ym.shape = s
134 xf.shape = s
135
136 assert_(not isMaskedArray(x))
137 assert_(isMaskedArray(xm))
138 assert_equal(shape(xm), s)
139 assert_equal(xm.shape, s)
140 assert_equal(xm.size, reduce(lambda x, y:x * y, s))
141 assert_equal(count(xm), len(m1) - reduce(lambda x, y:x + y, m1))
142 assert_equal(xm, xf)
143 assert_equal(filled(xm, 1.e20), xf)
144 assert_equal(x, xm)
145
146 def test_concatenate_basic(self):
147 # Tests concatenations.

Callers

nothing calls this directly

Calls 6

isMaskedArrayFunction · 0.90
assert_equalFunction · 0.90
shapeFunction · 0.90
countFunction · 0.90
filledFunction · 0.90
assert_Function · 0.50

Tested by

no test coverage detected