MCPcopy
hub / github.com/dask/dask / optimize

Function optimize

dask/delayed.py:659–670  ·  view source on GitHub ↗
(dsk, keys, **kwargs)

Source from the content-addressed store, hash-verified

657
658
659def optimize(dsk, keys, **kwargs):
660 if not isinstance(keys, (list, set)):
661 keys = [keys]
662
663 if config.get("optimization.fuse.delayed"):
664 dsk = ensure_dict(dsk)
665 dsk = fuse_linear_task_spec(dsk, keys, **kwargs)
666
667 if not isinstance(dsk, HighLevelGraph):
668 dsk = HighLevelGraph.from_collections(id(dsk), dsk, dependencies=())
669 dsk = dsk.cull(set(flatten(keys)))
670 return dsk
671
672
673class Delayed(DaskMethodsMixin, OperatorMethodMixin):

Callers 1

Calls 7

ensure_dictFunction · 0.90
fuse_linear_task_specFunction · 0.90
flattenFunction · 0.90
setClass · 0.85
from_collectionsMethod · 0.80
getMethod · 0.45
cullMethod · 0.45

Tested by 1

Used in the wild real call sites across dependent graphs

searching dependent graphs…