MCPcopy Create free account
hub / github.com/numpy/numpy / test_concatenate_alongaxis

Method test_concatenate_alongaxis

numpy/ma/tests/test_core.py:155–174  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

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.

Callers

nothing calls this directly

Calls 7

assert_equalFunction · 0.90
concatenateFunction · 0.90
arrayFunction · 0.90
onesFunction · 0.90
assert_array_equalFunction · 0.90
reshapeMethod · 0.80
zerosFunction · 0.50

Tested by

no test coverage detected