summaryrefslogtreecommitdiff
path: root/lib/utils.py
diff options
context:
space:
mode:
authorDaniel Friesel <daniel.friesel@uos.de>2022-08-31 15:47:56 +0200
committerDaniel Friesel <daniel.friesel@uos.de>2022-08-31 15:47:56 +0200
commit850b6daaca7424b326d94355caa9c7ba9239393e (patch)
tree9dd46cb931e2971caf5daaa89f607263f931f3ff /lib/utils.py
parent4c4c9f880520511047adc97be292a2a3a24e0d33 (diff)
utils: observations_ignore_param: handle unknown parameters
Diffstat (limited to 'lib/utils.py')
-rw-r--r--lib/utils.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/utils.py b/lib/utils.py
index f8ce6ad..1868b10 100644
--- a/lib/utils.py
+++ b/lib/utils.py
@@ -303,9 +303,17 @@ def observations_enum_to_bool(observations: list, kconfig=False):
def observations_ignore_param(observations: list, ignored_parameters: list) -> list:
+ unpoppable_params = set()
for observation in observations:
for ignored_parameter in ignored_parameters:
- observation["param"].pop(ignored_parameter)
+ try:
+ observation["param"].pop(ignored_parameter)
+ except KeyError:
+ unpoppable_params.add(ignored_parameter)
+ if unpoppable_params:
+ logger.info(
+ f"ignore_param: Parameters {unpoppable_params} were not part of the observations to begin with"
+ )
def observations_to_by_name(observations: list):