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

Method __dask_graph__

dask/_expr.py:569–595  ·  view source on GitHub ↗

Traverse expression tree, collect layers Subclasses generally do not want to override this method unless custom logic is required to treat (e.g. ignore) specific operands during graph generation. See also -------- Expr._layer Expr._task

(self)

Source from the content-addressed store, hash-verified

567 return {}
568
569 def __dask_graph__(self):
570 """Traverse expression tree, collect layers
571
572 Subclasses generally do not want to override this method unless custom
573 logic is required to treat (e.g. ignore) specific operands during graph
574 generation.
575
576 See also
577 --------
578 Expr._layer
579 Expr._task
580 """
581 stack = [self]
582 seen = set()
583 layers = []
584 while stack:
585 expr = stack.pop()
586
587 if expr._name in seen:
588 continue
589 seen.add(expr._name)
590
591 layers.append(expr._layer())
592 for operand in expr.dependencies():
593 stack.append(operand)
594
595 return toolz.merge(layers)
596
597 @property
598 def dask(self):

Callers 13

daskMethod · 0.95
_from_collectionMethod · 0.45
from_collectionsMethod · 0.45
bindFunction · 0.45
_bind_oneFunction · 0.45
from_collectionMethod · 0.45
_simplify_downMethod · 0.45
__dask_graph__Method · 0.45
get_asyncFunction · 0.45
is_dask_collectionFunction · 0.45
optimizeFunction · 0.45
visualizeFunction · 0.45

Calls 6

setClass · 0.85
popMethod · 0.80
addMethod · 0.45
_layerMethod · 0.45
dependenciesMethod · 0.45
mergeMethod · 0.45

Tested by

no test coverage detected