MCPcopy
hub / github.com/dask/dask / test_cull

Function test_cull

dask/tests/test_optimization.py:25–35  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

23
24
25def test_cull():
26 # 'out' depends on 'x' and 'y', but not 'z'
27 d = {"x": 1, "y": (inc, "x"), "z": (inc, "x"), "out": (add, "y", 10)}
28 culled, dependencies = cull(d, "out")
29 assert culled == {"x": 1, "y": (inc, "x"), "out": (add, "y", 10)}
30 assert dependencies == {"x": [], "y": ["x"], "out": ["y"]}
31
32 assert cull(d, "out") == cull(d, ["out"])
33 assert cull(d, ["out", "z"])[0] == d
34 assert cull(d, [["out"], ["z"]]) == cull(d, ["out", "z"])
35 pytest.raises(KeyError, lambda: cull(d, "badkey"))
36
37
38def fuse2(*args, **kwargs):

Callers

nothing calls this directly

Calls 1

cullFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…