From: Christian Heller Date: Wed, 5 Jun 2024 18:02:32 +0000 (+0200) Subject: Make explicit ProcessSteps overwrite implicit ones. X-Git-Url: https://plomlompom.com/repos/te"st.html?a=commitdiff_plain;h=c39bd250d747d2dd0bebee8c2f99f2c0fac6926c;p=plomtask Make explicit ProcessSteps overwrite implicit ones. --- diff --git a/plomtask/processes.py b/plomtask/processes.py index bfadc2b..089a710 100644 --- a/plomtask/processes.py +++ b/plomtask/processes.py @@ -93,6 +93,13 @@ class Process(BaseModel[int], ConditionsRelations): for child in explicit_children: assert isinstance(child.id_, int) node.steps[child.id_] = make_node(child) + # ensure that one (!) explicit step of process replaces + # one (!) implicit step of same process + for i in [i for i, s in node.steps.items() + if not s.is_explicit + and s.process.id_ == child.step_process_id]: + del node.steps[i] + break node.seen = node_id in seen_step_ids seen_step_ids.add(node_id) for id_, step in node.steps.items():