MCPcopy
hub / github.com/dask/dask / test_fuse_getter_with_asarray

Function test_fuse_getter_with_asarray

dask/array/tests/test_optimization.py:139–151  ·  view source on GitHub ↗
(chunks)

Source from the content-addressed store, hash-verified

137
138@pytest.mark.parametrize("chunks", [10, 5, 3])
139def test_fuse_getter_with_asarray(chunks):
140 x = np.ones(10) * 1234567890
141 y = da.ones(10, chunks=chunks)
142 z = x + y
143 dsk = z.__dask_optimize__(z.dask, z.__dask_keys__())
144 if chunks == 10:
145 assert len(dsk) == 2 and any(isinstance(t, Alias) for t in dsk.values())
146 else:
147 assert any(
148 isinstance(v, DataNode) and isinstance(v.value, np.ndarray)
149 for v in dsk.values()
150 )
151 assert_eq(z, x + 1)
152
153
154@pytest.mark.xfail(reason="blockwise fusion does not respect this, which is ok")

Callers

nothing calls this directly

Calls 6

assert_eqFunction · 0.90
anyFunction · 0.85
__dask_optimize__Method · 0.80
onesMethod · 0.45
__dask_keys__Method · 0.45
valuesMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…