| 4607 | assert_(z[2] is masked) |
| 4608 | |
| 4609 | def test_round_with_output(self): |
| 4610 | # Testing round with an explicit output |
| 4611 | |
| 4612 | xm = array(np.random.uniform(0, 10, 12)).reshape(3, 4) |
| 4613 | xm[:, 0] = xm[0] = xm[-1, -1] = masked |
| 4614 | |
| 4615 | # A ndarray as explicit input |
| 4616 | output = np.empty((3, 4), dtype=float) |
| 4617 | output.fill(-9999) |
| 4618 | result = np.round(xm, decimals=2, out=output) |
| 4619 | # ... the result should be the given output |
| 4620 | assert_(result is output) |
| 4621 | assert_equal(result, xm.round(decimals=2, out=output)) |
| 4622 | |
| 4623 | output = empty((3, 4), dtype=float) |
| 4624 | result = xm.round(decimals=2, out=output) |
| 4625 | assert_(result is output) |
| 4626 | |
| 4627 | def test_round_with_scalar(self): |
| 4628 | # Testing round with scalar/zero dimension input |