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

Method walk

dask/_expr.py:791–811  ·  view source on GitHub ↗

Iterate through all expressions in the tree Returns ------- nodes Generator of Expr instances in the graph. Ordering is a depth-first search of the expression tree

(self)

Source from the content-addressed store, hash-verified

789 return g
790
791 def walk(self) -> Generator[Expr]:
792 """Iterate through all expressions in the tree
793
794 Returns
795 -------
796 nodes
797 Generator of Expr instances in the graph.
798 Ordering is a depth-first search of the expression tree
799 """
800 stack = [self]
801 seen = set()
802 while stack:
803 node = stack.pop()
804 if node._name in seen:
805 continue
806 seen.add(node._name)
807
808 for dep in node.dependencies():
809 stack.append(dep)
810
811 yield node
812
813 def find_operations(self, operation: type | tuple[type]) -> Generator[Expr]:
814 """Search the expression graph for a specific operation type

Callers 1

find_operationsMethod · 0.95

Calls 4

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

Tested by

no test coverage detected