| 369 | assert_(eq(y5, y6)) |
| 370 | |
| 371 | def test_testPut(self): |
| 372 | # Test of put |
| 373 | d = arange(5) |
| 374 | n = [0, 0, 0, 1, 1] |
| 375 | m = make_mask(n) |
| 376 | m2 = m.copy() |
| 377 | x = array(d, mask=m) |
| 378 | assert_(x[3] is masked) |
| 379 | assert_(x[4] is masked) |
| 380 | x[[1, 4]] = [10, 40] |
| 381 | assert_(x._mask is m) |
| 382 | assert_(x[3] is masked) |
| 383 | assert_(x[4] is not masked) |
| 384 | assert_(eq(x, [0, 10, 2, -1, 40])) |
| 385 | |
| 386 | x = array(d, mask=m2, copy=True) |
| 387 | x.put([0, 1, 2], [-1, 100, 200]) |
| 388 | assert_(x._mask is not m2) |
| 389 | assert_(x[3] is masked) |
| 390 | assert_(x[4] is masked) |
| 391 | assert_(eq(x, [-1, 100, 200, 0, 0])) |
| 392 | |
| 393 | def test_testPut2(self): |
| 394 | # Test of put |