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

Function test_block_complicated

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

Source from the content-addressed store, hash-verified

983
984
985def test_block_complicated():
986 # a bit more complicated
987 a1 = np.array([[1, 1, 1]])
988 a2 = np.array([[2, 2, 2]])
989 a3 = np.array([[3, 3, 3, 3, 3, 3]])
990 a4 = np.array([4, 4, 4, 4, 4, 4])
991 a5 = np.array(5)
992 a6 = np.array([6, 6, 6, 6, 6])
993 a7 = np.zeros((2, 6))
994
995 d1 = da.asarray(a1)
996 d2 = da.asarray(a2)
997 d3 = da.asarray(a3)
998 d4 = da.asarray(a4)
999 d5 = da.asarray(a5)
1000 d6 = da.asarray(a6)
1001 d7 = da.asarray(a7)
1002
1003 expected = np.block([[a1, a2], [a3], [a4], [a5, a6], [a7]])
1004 result = da.block([[d1, d2], [d3], [d4], [d5, d6], [d7]])
1005
1006 assert_eq(expected, result)
1007
1008
1009def test_block_nested():

Callers

nothing calls this directly

Calls 2

assert_eqFunction · 0.90
zerosMethod · 0.45

Tested by

no test coverage detected