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

Function test_concatenate_axes

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

Source from the content-addressed store, hash-verified

3989
3990
3991def test_concatenate_axes():
3992 x = np.ones((2, 2, 2))
3993
3994 assert_eq(concatenate_axes([x, x], axes=[0]), np.ones((4, 2, 2)))
3995 assert_eq(concatenate_axes([x, x, x], axes=[0]), np.ones((6, 2, 2)))
3996 assert_eq(concatenate_axes([x, x], axes=[1]), np.ones((2, 4, 2)))
3997 assert_eq(concatenate_axes([[x, x], [x, x]], axes=[0, 1]), np.ones((4, 4, 2)))
3998 assert_eq(concatenate_axes([[x, x], [x, x]], axes=[0, 2]), np.ones((4, 2, 4)))
3999 assert_eq(concatenate_axes([[x, x, x], [x, x, x]], axes=[1, 2]), np.ones((2, 4, 6)))
4000
4001 with pytest.raises(ValueError):
4002 concatenate_axes(
4003 [[x, x], [x, x]], axes=[0]
4004 ) # not all nested lists accounted for
4005 with pytest.raises(ValueError):
4006 concatenate_axes([x, x], axes=[0, 1, 2, 3]) # too many axes
4007
4008
4009def test_blockwise_concatenate():

Callers

nothing calls this directly

Calls 3

assert_eqFunction · 0.90
concatenate_axesFunction · 0.90
onesMethod · 0.45

Tested by

no test coverage detected