(self)
| 196 | assert_(x.filled().dtype is x._data.dtype) |
| 197 | |
| 198 | def test_basic1d(self): |
| 199 | # Test of basic array creation and properties in 1 dimension. |
| 200 | x, _, _, m1, _, xm, ym, z, zm, xf = self._create_data() |
| 201 | assert_(not isMaskedArray(x)) |
| 202 | assert_(isMaskedArray(xm)) |
| 203 | assert_((xm - ym).filled(0).any()) |
| 204 | fail_if_equal(xm.mask.astype(int), ym.mask.astype(int)) |
| 205 | s = x.shape |
| 206 | assert_equal(np.shape(xm), s) |
| 207 | assert_equal(xm.shape, s) |
| 208 | assert_equal(xm.dtype, x.dtype) |
| 209 | assert_equal(zm.dtype, z.dtype) |
| 210 | assert_equal(xm.size, reduce(lambda x, y: x * y, s)) |
| 211 | assert_equal(count(xm), len(m1) - reduce(lambda x, y: x + y, m1)) |
| 212 | assert_array_equal(xm, xf) |
| 213 | assert_array_equal(filled(xm, 1.e20), xf) |
| 214 | assert_array_equal(x, xm) |
| 215 | |
| 216 | def test_basic2d(self): |
| 217 | # Test of basic array creation and properties in 2 dimensions. |
nothing calls this directly
no test coverage detected