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

Function test_concatenate_rechunk

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

Source from the content-addressed store, hash-verified

844
845
846def test_concatenate_rechunk():
847 rng = da.random.default_rng()
848 x = rng.random((6, 6), chunks=(3, 3))
849 y = rng.random((6, 6), chunks=(2, 2))
850
851 z = da.concatenate([x, y], axis=0)
852 assert z.shape == (12, 6)
853 assert z.chunks == ((3, 3, 2, 2, 2), (2, 1, 1, 2))
854 assert_eq(z, np.concatenate([x.compute(), y.compute()], axis=0))
855
856 z = da.concatenate([x, y], axis=1)
857 assert z.shape == (6, 12)
858 assert z.chunks == ((2, 1, 1, 2), (3, 3, 2, 2, 2))
859 assert_eq(z, np.concatenate([x.compute(), y.compute()], axis=1))
860
861
862def test_concatenate_fixlen_strings():

Callers

nothing calls this directly

Calls 3

assert_eqFunction · 0.90
randomMethod · 0.45
computeMethod · 0.45

Tested by

no test coverage detected