MCPcopy Create free account
hub / github.com/dask/dask / test_concatenate3_2

Function test_concatenate3_2

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

Source from the content-addressed store, hash-verified

3160
3161
3162def test_concatenate3_2():
3163 x = np.array([1, 2])
3164 assert_eq(concatenate3([x, x, x]), np.array([1, 2, 1, 2, 1, 2]))
3165
3166 x = np.array([[1, 2]])
3167 assert (
3168 concatenate3([[x, x, x], [x, x, x]])
3169 == np.array([[1, 2, 1, 2, 1, 2], [1, 2, 1, 2, 1, 2]])
3170 ).all()
3171
3172 assert (
3173 concatenate3([[x, x], [x, x], [x, x]])
3174 == np.array([[1, 2, 1, 2], [1, 2, 1, 2], [1, 2, 1, 2]])
3175 ).all()
3176
3177 x = np.arange(12).reshape((2, 2, 3))
3178 assert_eq(
3179 concatenate3([[[x, x, x], [x, x, x]], [[x, x, x], [x, x, x]]]),
3180 np.array(
3181 [
3182 [
3183 [0, 1, 2, 0, 1, 2, 0, 1, 2],
3184 [3, 4, 5, 3, 4, 5, 3, 4, 5],
3185 [0, 1, 2, 0, 1, 2, 0, 1, 2],
3186 [3, 4, 5, 3, 4, 5, 3, 4, 5],
3187 ],
3188 [
3189 [6, 7, 8, 6, 7, 8, 6, 7, 8],
3190 [9, 10, 11, 9, 10, 11, 9, 10, 11],
3191 [6, 7, 8, 6, 7, 8, 6, 7, 8],
3192 [9, 10, 11, 9, 10, 11, 9, 10, 11],
3193 ],
3194 [
3195 [0, 1, 2, 0, 1, 2, 0, 1, 2],
3196 [3, 4, 5, 3, 4, 5, 3, 4, 5],
3197 [0, 1, 2, 0, 1, 2, 0, 1, 2],
3198 [3, 4, 5, 3, 4, 5, 3, 4, 5],
3199 ],
3200 [
3201 [6, 7, 8, 6, 7, 8, 6, 7, 8],
3202 [9, 10, 11, 9, 10, 11, 9, 10, 11],
3203 [6, 7, 8, 6, 7, 8, 6, 7, 8],
3204 [9, 10, 11, 9, 10, 11, 9, 10, 11],
3205 ],
3206 ]
3207 ),
3208 )
3209
3210
3211def 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