From ea7cb38bcbae052e39f492faf237a73d05e7770d Mon Sep 17 00:00:00 2001 From: Serwan Asaad Date: Fri, 16 Feb 2024 16:34:08 +0100 Subject: [PATCH] hotfix: final config actions check for keys --- quam/utils/config.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/quam/utils/config.py b/quam/utils/config.py index 238d8e25..e46fdaef 100644 --- a/quam/utils/config.py +++ b/quam/utils/config.py @@ -10,9 +10,10 @@ def generate_config_final_actions(qua_config): Args: qua_config (dict): The generated qua config. """ - for controller_cfg in qua_config["controllers"].values(): - for analog_output in controller_cfg["analog_outputs"].values(): - analog_output.setdefault("offset", 0.0) - for analog_input in controller_cfg["analog_inputs"].values(): - analog_input.setdefault("offset", 0.0) + if "analog_outputs" in controller_cfg: + for analog_output in controller_cfg["analog_outputs"].values(): + analog_output.setdefault("offset", 0.0) + if "analog_inputs" in controller_cfg: + for analog_input in controller_cfg["analog_inputs"].values(): + analog_input.setdefault("offset", 0.0)