(self, cls=np.ndarray)
| 187 | assert_array_equal(res, np.array([6, 6, 6]).view(cls)) |
| 188 | |
| 189 | def test_0d_array(self, cls=np.ndarray): |
| 190 | def sum_to_0d(x): |
| 191 | """ Sum x, returning a 0d array of the same class """ |
| 192 | assert_equal(x.ndim, 1) |
| 193 | return np.squeeze(np.sum(x, keepdims=True)) |
| 194 | a = np.ones((6, 3)).view(cls) |
| 195 | res = apply_along_axis(sum_to_0d, 0, a) |
| 196 | assert_(isinstance(res, cls)) |
| 197 | assert_array_equal(res, np.array([6, 6, 6]).view(cls)) |
| 198 | |
| 199 | res = apply_along_axis(sum_to_0d, 1, a) |
| 200 | assert_(isinstance(res, cls)) |
| 201 | assert_array_equal(res, np.array([3, 3, 3, 3, 3, 3]).view(cls)) |
| 202 | |
| 203 | def test_axis_insertion(self, cls=np.ndarray): |
| 204 | def f1to2(x): |
no test coverage detected