From c39bd250d747d2dd0bebee8c2f99f2c0fac6926c Mon Sep 17 00:00:00 2001 From: Christian Heller Date: Wed, 5 Jun 2024 20:02:32 +0200 Subject: [PATCH] Make explicit ProcessSteps overwrite implicit ones. --- plomtask/processes.py | 7 +++++++ 1 file changed, 7 insertions(+) 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(): -- 2.30.2