(self)
| 216 | self.test_axis_insertion(MinimalSubclass) |
| 217 | |
| 218 | def test_axis_insertion_ma(self): |
| 219 | def f1to2(x): |
| 220 | """produces an asymmetric non-square matrix from x""" |
| 221 | assert_equal(x.ndim, 1) |
| 222 | res = x[::-1] * x[1:,None] |
| 223 | return np.ma.masked_where(res%5==0, res) |
| 224 | a = np.arange(6*3).reshape((6, 3)) |
| 225 | res = apply_along_axis(f1to2, 0, a) |
| 226 | assert_(isinstance(res, np.ma.masked_array)) |
| 227 | assert_equal(res.ndim, 3) |
| 228 | assert_array_equal(res[:,:,0].mask, f1to2(a[:,0]).mask) |
| 229 | assert_array_equal(res[:,:,1].mask, f1to2(a[:,1]).mask) |
| 230 | assert_array_equal(res[:,:,2].mask, f1to2(a[:,2]).mask) |
| 231 | |
| 232 | def test_tuple_func1d(self): |
| 233 | def sample_1d(x): |
nothing calls this directly
no test coverage detected