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

Function demo_tuples

dask/tests/test_graph_manipulation.py:112–127  ·  view source on GitHub ↗
(layers: bool)

Source from the content-addressed store, hash-verified

110
111
112def demo_tuples(layers: bool) -> tuple[Tuple, Tuple, NodeCounter]:
113 cnt = NodeCounter()
114 # Collections have multiple names
115 dsk1 = HighLevelGraph(
116 {"a": {("a", h1): (cnt.f, 1), ("a", h2): (cnt.f, 2)}, "b": {"b": (cnt.f, 3)}},
117 {"a": set(), "b": set()},
118 )
119 dsk2 = HighLevelGraph(
120 {"c": {"c": (cnt.f, 4)}, "d": {"d": (cnt.f, 5)}},
121 {"c": set(), "d": set()},
122 )
123 if not layers:
124 dsk1 = dsk1.to_dict() # type: ignore[assignment]
125 dsk2 = dsk2.to_dict() # type: ignore[assignment]
126
127 return Tuple(dsk1, list(dsk1)), Tuple(dsk2, list(dsk2)), cnt
128
129
130@pytest.mark.parametrize("layers", [False, True])

Callers 3

test_checkpointFunction · 0.85
test_wait_on_oneFunction · 0.85
test_wait_on_manyFunction · 0.85

Calls 5

to_dictMethod · 0.95
HighLevelGraphClass · 0.90
TupleClass · 0.90
NodeCounterClass · 0.85
setClass · 0.85

Tested by

no test coverage detected