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

Function test_concatenate3_2

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

Source from the content-addressed store, hash-verified

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