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

Method test_basic2d

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

Source from the content-addressed store, hash-verified

214 assert_array_equal(x, xm)
215
216 def test_basic2d(self):
217 # Test of basic array creation and properties in 2 dimensions.
218 x, y, _, m1, _, xm, ym, _, _, xf = self._create_data()
219 for s in [(4, 3), (6, 2)]:
220 x = x.reshape(s)
221 y = y.reshape(s)
222 xm = xm.reshape(s)
223 ym = ym.reshape(s)
224 xf = xf.reshape(s)
225
226 assert_(not isMaskedArray(x))
227 assert_(isMaskedArray(xm))
228 assert_equal(shape(xm), s)
229 assert_equal(xm.shape, s)
230 assert_equal(xm.size, reduce(lambda x, y: x * y, s))
231 assert_equal(count(xm), len(m1) - reduce(lambda x, y: x + y, m1))
232 assert_equal(xm, xf)
233 assert_equal(filled(xm, 1.e20), xf)
234 assert_equal(x, xm)
235
236 def test_concatenate_basic(self):
237 # Tests concatenations.

Callers

nothing calls this directly

Calls 8

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

Tested by

no test coverage detected