From f0c4a99f99da5e213f97276fd3f2f7bbf3232905 Mon Sep 17 00:00:00 2001 From: Birte Kristina Friesel Date: Fri, 22 Mar 2024 09:23:24 +0100 Subject: handle mis-specified param filters --- lib/utils.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/utils.py b/lib/utils.py index 3778fc0..426b701 100644 --- a/lib/utils.py +++ b/lib/utils.py @@ -556,7 +556,11 @@ def filter_aggregate_by_param(aggregate, parameters, parameter_filter): :param parameter_filter: [[name, value], [name, value], ...] list of parameter values to keep, all others are removed. Values refer to normalizad parameter data. """ for param_name, condition, param_value in parameter_filter: - param_index = parameters.index(param_name) + try: + param_index = parameters.index(param_name) + except ValueError: + logger.error(f"Unknown parameter '{param_name}'") + return param_value = soft_cast_int(param_value) names_to_remove = set() -- cgit v1.2.3