diff options
author | Birte Kristina Friesel <birte.friesel@uos.de> | 2024-03-22 09:23:24 +0100 |
---|---|---|
committer | Birte Kristina Friesel <birte.friesel@uos.de> | 2024-03-22 09:23:24 +0100 |
commit | f0c4a99f99da5e213f97276fd3f2f7bbf3232905 (patch) | |
tree | 59cebf4e37e2af30c03f35e32916d8cefef57419 /lib | |
parent | 81a1b42c554414bf9f0995741a866ebd1ece6c3c (diff) |
handle mis-specified param filters
Diffstat (limited to 'lib')
-rw-r--r-- | lib/utils.py | 6 |
1 files changed, 5 insertions, 1 deletions
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() |