From ee0da20c241117e3ff44fd25209dcbcb424fec34 Mon Sep 17 00:00:00 2001 From: Steinn Ymir Agustsson Date: Thu, 9 Nov 2023 13:50:27 +0100 Subject: [PATCH] fix bool check --- sed/calibrator/energy.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sed/calibrator/energy.py b/sed/calibrator/energy.py index 2a8085b5..2db10425 100644 --- a/sed/calibrator/energy.py +++ b/sed/calibrator/energy.py @@ -1525,13 +1525,13 @@ def add_offsets( except KeyError as exc: raise KeyError(f"Missing sign for offset column {k} in config.") from exc pm = v.get("preserve_mean", False) - if pm == "false": + if str(pm).lower() in ["false", "0", "no"]: pm = False - elif pm == "true": + elif str(pm).lower() in ["true", "1", "yes"]: pm = True preserve_mean.append(pm) rd = v.get("reduction", None) - if rd == "none": + if str(rd).lower() == "none": rd = None reductions.append(rd)