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

Method __dask_graph__

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

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