(self)
| 245 | self.test_axis_insertion(MinimalSubclass) |
| 246 | |
| 247 | def test_axis_insertion_ma(self): |
| 248 | def f1to2(x): |
| 249 | """produces an asymmetric non-square matrix from x""" |
| 250 | assert_equal(x.ndim, 1) |
| 251 | res = x[::-1] * x[1:, None] |
| 252 | return np.ma.masked_where(res % 5 == 0, res) |
| 253 | a = np.arange(6 * 3).reshape((6, 3)) |
| 254 | res = apply_along_axis(f1to2, 0, a) |
| 255 | assert_(isinstance(res, np.ma.masked_array)) |
| 256 | assert_equal(res.ndim, 3) |
| 257 | assert_array_equal(res[:, :, 0].mask, f1to2(a[:, 0]).mask) |
| 258 | assert_array_equal(res[:, :, 1].mask, f1to2(a[:, 1]).mask) |
| 259 | assert_array_equal(res[:, :, 2].mask, f1to2(a[:, 2]).mask) |
| 260 | |
| 261 | def test_tuple_func1d(self): |
| 262 | def sample_1d(x): |
nothing calls this directly
no test coverage detected