| 307 | assert_(eq(y5, y6)) |
| 308 | |
| 309 | def test_testPut(self): |
| 310 | # Test of put |
| 311 | d = arange(5) |
| 312 | n = [0, 0, 0, 1, 1] |
| 313 | m = make_mask(n) |
| 314 | m2 = m.copy() |
| 315 | x = array(d, mask=m) |
| 316 | assert_(x[3] is masked) |
| 317 | assert_(x[4] is masked) |
| 318 | x[[1, 4]] = [10, 40] |
| 319 | assert_(x._mask is m) |
| 320 | assert_(x[3] is masked) |
| 321 | assert_(x[4] is not masked) |
| 322 | assert_(eq(x, [0, 10, 2, -1, 40])) |
| 323 | |
| 324 | x = array(d, mask=m2, copy=True) |
| 325 | x.put([0, 1, 2], [-1, 100, 200]) |
| 326 | assert_(x._mask is not m2) |
| 327 | assert_(x[3] is masked) |
| 328 | assert_(x[4] is masked) |
| 329 | assert_(eq(x, [-1, 100, 200, 0, 0])) |
| 330 | |
| 331 | def test_testPut2(self): |
| 332 | # Test of put |