diff options
author | Birte Kristina Friesel <birte.friesel@uos.de> | 2024-07-09 16:13:28 +0200 |
---|---|---|
committer | Birte Kristina Friesel <birte.friesel@uos.de> | 2024-07-09 16:13:28 +0200 |
commit | dcf3ca444a3f820f5f3ae3a55f975e40f1c41526 (patch) | |
tree | d624dd8ecd45cddcb12ed340cb12a31ea4deb801 /lib | |
parent | 6c8cb4739bbe4a3e1f8a669a08d9145c3982aae5 (diff) |
filter_aggregate_by_param: <> only work for non-None values
Diffstat (limited to 'lib')
-rw-r--r-- | lib/utils.py | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/lib/utils.py b/lib/utils.py index 426b701..1c639ca 100644 --- a/lib/utils.py +++ b/lib/utils.py @@ -560,22 +560,30 @@ def filter_aggregate_by_param(aggregate, parameters, parameter_filter): param_index = parameters.index(param_name) except ValueError: logger.error(f"Unknown parameter '{param_name}'") - return + continue param_value = soft_cast_int(param_value) names_to_remove = set() if condition == "<": - condf = lambda x: x[param_index] < param_value + condf = ( + lambda x: x[param_index] is not None and x[param_index] < param_value + ) elif condition == "≤": - condf = lambda x: x[param_index] <= param_value + condf = ( + lambda x: x[param_index] is not None and x[param_index] <= param_value + ) elif condition == "=": condf = lambda x: x[param_index] == param_value elif condition == "≠": condf = lambda x: x[param_index] != param_value elif condition == "≥": - condf = lambda x: x[param_index] >= param_value + condf = ( + lambda x: x[param_index] is not None and x[param_index] >= param_value + ) elif condition == ">": - condf = lambda x: x[param_index] > param_value + condf = ( + lambda x: x[param_index] is not None and x[param_index] > param_value + ) elif condition == "∈": param_values = tuple(map(soft_cast_int, param_value.split(","))) condf = lambda x: x[param_index] in param_values |