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

Function test_block_nested

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

Source from the content-addressed store, hash-verified

1007
1008
1009def test_block_nested():
1010 a1 = np.array([1, 1, 1])
1011 a2 = np.array([[2, 2, 2], [2, 2, 2], [2, 2, 2]])
1012 a3 = np.array([3, 3, 3])
1013 a4 = np.array([4, 4, 4])
1014 a5 = np.array(5)
1015 a6 = np.array([6, 6, 6, 6, 6])
1016 a7 = np.zeros((2, 6))
1017
1018 d1 = da.asarray(a1)
1019 d2 = da.asarray(a2)
1020 d3 = da.asarray(a3)
1021 d4 = da.asarray(a4)
1022 d5 = da.asarray(a5)
1023 d6 = da.asarray(a6)
1024 d7 = da.asarray(a7)
1025
1026 expected = np.block([[np.block([[a1], [a3], [a4]]), a2], [a5, a6], [a7]])
1027 result = da.block([[da.block([[d1], [d3], [d4]]), d2], [d5, d6], [d7]])
1028
1029 assert_eq(expected, result)
1030
1031
1032def test_block_3d():

Callers

nothing calls this directly

Calls 2

assert_eqFunction · 0.90
zerosMethod · 0.45

Tested by

no test coverage detected