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

Method test_testPut2

numpy/ma/tests/test_old_ma.py:331–355  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

329 assert_(eq(x, [-1, 100, 200, 0, 0]))
330
331 def test_testPut2(self):
332 # Test of put
333 d = arange(5)
334 x = array(d, mask=[0, 0, 0, 0, 0])
335 z = array([10, 40], mask=[1, 0])
336 assert_(x[2] is not masked)
337 assert_(x[3] is not masked)
338 x[2:4] = z
339 assert_(x[2] is masked)
340 assert_(x[3] is not masked)
341 assert_(eq(x, [0, 1, 10, 40, 4]))
342
343 d = arange(5)
344 x = array(d, mask=[0, 0, 0, 0, 0])
345 y = x[2:4]
346 z = array([10, 40], mask=[1, 0])
347 assert_(x[2] is not masked)
348 assert_(x[3] is not masked)
349 y[:] = z
350 assert_(y[0] is masked)
351 assert_(y[1] is not masked)
352 assert_(eq(y, [10, 40]))
353 assert_(x[2] is masked)
354 assert_(x[3] is not masked)
355 assert_(eq(x, [0, 1, 10, 40, 4]))
356
357 def test_testMaPut(self):
358 (x, y, a10, m1, m2, xm, ym, z, zm, xf, s) = self.d

Callers

nothing calls this directly

Calls 4

arrayFunction · 0.90
assert_Function · 0.90
arangeFunction · 0.85
eqFunction · 0.85

Tested by

no test coverage detected