From d9a947518ea292c29b226fc5d8e7e6699150ee5b Mon Sep 17 00:00:00 2001 From: Mark Nestor Costantini Date: Thu, 16 May 2024 18:36:20 +0100 Subject: [PATCH] restored previous behaviour of produce_defaults function --- validphys2/src/validphys/config.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/validphys2/src/validphys/config.py b/validphys2/src/validphys/config.py index c8fc6728ac..a0288419f4 100644 --- a/validphys2/src/validphys/config.py +++ b/validphys2/src/validphys/config.py @@ -1407,14 +1407,14 @@ def produce_defaults( if isinstance(filter_defaults, FilterDefaults): filter_defaults = filter_defaults.to_dict() - if q2min is not None and filter_defaults["q2min"] != q2min: - raise ConfigError("q2min defined multiple times with different values") - - if w2min is not None and filter_defaults["w2min"] != w2min: - raise ConfigError("w2min defined multiple times with different values") - - if maxTau is not None and filter_defaults["maxTau"] != maxTau: - raise ConfigError("maxTau defined multiple times with different values") + if q2min is not None and "q2min" in filter_defaults and q2min != filter_defaults["q2min"]: + raise ConfigError("q2min defined multiple times with different values") + + if w2min is not None and "w2min" in filter_defaults and w2min != filter_defaults["w2min"]: + raise ConfigError("w2min defined multiple times with different values") + + if maxTau is not None and filter_defaults["maxTau"] != maxTau: + raise ConfigError("maxTau defined multiple times with different values") if default_filter_settings_recorded_spec_ is not None: filter_defaults = FilterDefaults(**default_filter_settings_recorded_spec_[default_filter_settings])