MCPcopy
hub / github.com/dask/dask / __dask_graph__

Method __dask_graph__

dask/_expr.py:554–580  ·  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

552 return {}
553
554 def __dask_graph__(self):
555 """Traverse expression tree, collect layers
556
557 Subclasses generally do not want to override this method unless custom
558 logic is required to treat (e.g. ignore) specific operands during graph
559 generation.
560
561 See also
562 --------
563 Expr._layer
564 Expr._task
565 """
566 stack = [self]
567 seen = set()
568 layers = []
569 while stack:
570 expr = stack.pop()
571
572 if expr._name in seen:
573 continue
574 seen.add(expr._name)
575
576 layers.append(expr._layer())
577 for operand in expr.dependencies():
578 stack.append(operand)
579
580 return toolz.merge(layers)
581
582 @property
583 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