(self)
| 153 | assert_equal(np.concatenate((x, y, x)), concatenate((x, ym, x))) |
| 154 | |
| 155 | def test_concatenate_alongaxis(self): |
| 156 | # Tests concatenations. |
| 157 | (x, y, a10, m1, m2, xm, ym, z, zm, xf) = self.d |
| 158 | # Concatenation along an axis |
| 159 | s = (3, 4) |
| 160 | x.shape = y.shape = xm.shape = ym.shape = s |
| 161 | assert_equal(xm.mask, np.reshape(m1, s)) |
| 162 | assert_equal(ym.mask, np.reshape(m2, s)) |
| 163 | xmym = concatenate((xm, ym), 1) |
| 164 | assert_equal(np.concatenate((x, y), 1), xmym) |
| 165 | assert_equal(np.concatenate((xm.mask, ym.mask), 1), xmym._mask) |
| 166 | |
| 167 | x = zeros(2) |
| 168 | y = array(ones(2), mask=[False, True]) |
| 169 | z = concatenate((x, y)) |
| 170 | assert_array_equal(z, [0, 0, 1, 1]) |
| 171 | assert_array_equal(z.mask, [False, False, False, True]) |
| 172 | z = concatenate((y, x)) |
| 173 | assert_array_equal(z, [1, 1, 0, 0]) |
| 174 | assert_array_equal(z.mask, [False, True, False, False]) |
| 175 | |
| 176 | def test_concatenate_flexible(self): |
| 177 | # Tests the concatenation on flexible arrays. |
nothing calls this directly
no test coverage detected