MCPcopy
hub / github.com/dask/dask / optimizer_with_annotations

Function optimizer_with_annotations

dask/tests/test_hlgexpr.py:179–189  ·  view source on GitHub ↗
(dsk, keys)

Source from the content-addressed store, hash-verified

177
178
179def optimizer_with_annotations(dsk, keys):
180 annots = {}
181 for layer in dsk.layers.values():
182 if layer.annotations:
183 annots.update(layer.annotations)
184 out = optimizer(dsk, keys)
185 out = {f"{key}-optimized": val for key, val in out.items()}
186 return HighLevelGraph(
187 layers={"fused": MaterializedLayer(out, annotations=annots)},
188 dependencies={"fused": set()},
189 )
190
191
192def test_hlg_sequence_uses_annotations_of_optimized_dsk():

Callers 1

only_optimize_with_zFunction · 0.85

Calls 6

HighLevelGraphClass · 0.90
MaterializedLayerClass · 0.90
optimizerFunction · 0.85
setClass · 0.85
valuesMethod · 0.45
itemsMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…