From 2d89290854d10a22a0c333736803e8b7be385bb2 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Wed, 20 May 2020 13:49:11 +0200 Subject: automata: Handle set_param before arg_to_param_map --- lib/automata.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/automata.py b/lib/automata.py index 8a43e8f..b7668c5 100755 --- a/lib/automata.py +++ b/lib/automata.py @@ -452,12 +452,14 @@ class Transition: if self.param_update_function: return self.param_update_function(param_dict, args) ret = param_dict.copy() - if self.arg_to_param_map: - for k, v in self.arg_to_param_map.items(): - ret[v] = args[k] + # set_param is for default values, arg_to_param_map may contain optional overrides. + # So arg_to_param_map must come last. if self.set_param: for k, v in self.set_param.items(): ret[k] = v + if self.arg_to_param_map: + for k, v in self.arg_to_param_map.items(): + ret[v] = args[k] return ret def to_json(self) -> dict: -- cgit v1.2.3