MCPcopy
hub / github.com/dask/dask / test_concatenate3_2

Function test_concatenate3_2

dask/array/tests/test_array_core.py:3169–3215  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3167
3168
3169def test_concatenate3_2():
3170 x = np.array([1, 2])
3171 assert_eq(concatenate3([x, x, x]), np.array([1, 2, 1, 2, 1, 2]))
3172
3173 x = np.array([[1, 2]])
3174 assert (
3175 concatenate3([[x, x, x], [x, x, x]])
3176 == np.array([[1, 2, 1, 2, 1, 2], [1, 2, 1, 2, 1, 2]])
3177 ).all()
3178
3179 assert (
3180 concatenate3([[x, x], [x, x], [x, x]])
3181 == np.array([[1, 2, 1, 2], [1, 2, 1, 2], [1, 2, 1, 2]])
3182 ).all()
3183
3184 x = np.arange(12).reshape((2, 2, 3))
3185 assert_eq(
3186 concatenate3([[[x, x, x], [x, x, x]], [[x, x, x], [x, x, x]]]),
3187 np.array(
3188 [
3189 [
3190 [0, 1, 2, 0, 1, 2, 0, 1, 2],
3191 [3, 4, 5, 3, 4, 5, 3, 4, 5],
3192 [0, 1, 2, 0, 1, 2, 0, 1, 2],
3193 [3, 4, 5, 3, 4, 5, 3, 4, 5],
3194 ],
3195 [
3196 [6, 7, 8, 6, 7, 8, 6, 7, 8],
3197 [9, 10, 11, 9, 10, 11, 9, 10, 11],
3198 [6, 7, 8, 6, 7, 8, 6, 7, 8],
3199 [9, 10, 11, 9, 10, 11, 9, 10, 11],
3200 ],
3201 [
3202 [0, 1, 2, 0, 1, 2, 0, 1, 2],
3203 [3, 4, 5, 3, 4, 5, 3, 4, 5],
3204 [0, 1, 2, 0, 1, 2, 0, 1, 2],
3205 [3, 4, 5, 3, 4, 5, 3, 4, 5],
3206 ],
3207 [
3208 [6, 7, 8, 6, 7, 8, 6, 7, 8],
3209 [9, 10, 11, 9, 10, 11, 9, 10, 11],
3210 [6, 7, 8, 6, 7, 8, 6, 7, 8],
3211 [9, 10, 11, 9, 10, 11, 9, 10, 11],
3212 ],
3213 ]
3214 ),
3215 )
3216
3217
3218def test_map_blocks3():

Callers

nothing calls this directly

Calls 5

assert_eqFunction · 0.90
concatenate3Function · 0.90
reshapeMethod · 0.80
allMethod · 0.45
arangeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…