MCPcopy
hub / github.com/zenml-io/zenml / build_dag

Function build_dag

src/zenml/utils/run_utils.py:170–185  ·  view source on GitHub ↗

Build DAG with downstream steps from a list of steps. Args: steps: The list of steps. Returns: The DAG with downstream steps.

(steps: Dict[str, List[str]])

Source from the content-addressed store, hash-verified

168
169
170def build_dag(steps: Dict[str, List[str]]) -> Dict[str, Set[str]]:
171 """Build DAG with downstream steps from a list of steps.
172
173 Args:
174 steps: The list of steps.
175
176 Returns:
177 The DAG with downstream steps.
178 """
179 dag: Dict[str, Set[str]] = {step: set() for step in steps}
180
181 for step_name, upstream_steps in steps.items():
182 for upstream_step in upstream_steps:
183 dag[upstream_step].add(step_name)
184
185 return dag
186
187
188def find_all_downstream_steps(

Callers 8

test_linear_pipelineMethod · 0.90
test_diamond_pipelineMethod · 0.90
test_complex_pipelineMethod · 0.90
test_build_dagFunction · 0.85

Calls 1

addMethod · 0.80

Tested by 7

test_linear_pipelineMethod · 0.72
test_diamond_pipelineMethod · 0.72
test_complex_pipelineMethod · 0.72
test_build_dagFunction · 0.68