hydromodpy.workflow.dag#

Workflow DAG built from declared step dependencies.

The WorkflowDAG collects an ordered set of workflow steps and computes parallelisable cohorts using Kahn’s topological sort. Each step exposes depends_on() -> tuple[str, ...] referencing the names of predecessor steps. Cycles raise WorkflowDAGCycleError.

A cohort is a tuple of steps that can be executed concurrently because all their predecessors live in earlier cohorts. The default standard_steps() declaration produces 11 cohorts (only build_geographic and load_data form a 2-step cohort today).

Functions

topological_cohorts(steps)

Shortcut returning Kahn cohorts for an iterable of workflow steps.

Classes

StepEdge(src, dst)

Directed dependency edge src -> dst in the workflow DAG.

WorkflowDAG(steps)

Workflow DAG over named steps with parallel cohort detection.