summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Friesel <daniel.friesel@uos.de>2022-06-15 08:43:29 +0200
committerDaniel Friesel <daniel.friesel@uos.de>2022-06-15 08:43:29 +0200
commitee4c5d3cd512e905fce230965e9e7836015fa30e (patch)
treebb782a2c3ed7ba06d4d45ac968b5766f3bd24c0b /lib
parentc1dfcd4dca136da8dac5a2ec09e15d744f905734 (diff)
shift_param_in_aggregate: add '*=...' support
Diffstat (limited to 'lib')
-rw-r--r--lib/utils.py22
1 files changed, 15 insertions, 7 deletions
diff --git a/lib/utils.py b/lib/utils.py
index 77f9954..12bd7c2 100644
--- a/lib/utils.py
+++ b/lib/utils.py
@@ -433,13 +433,21 @@ def shift_param_in_aggregate(aggregate, parameters, parameter_shift):
: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, param_shift_function in parameter_shift:
- param_index = parameters.index(param_name)
- for name in aggregate.keys():
- for param_list in aggregate[name]["param"]:
- if param_list[param_index] is not None:
- param_list[param_index] = param_shift_function(
- param_list[param_index]
- )
+ if param_name == "*":
+ for name in aggregate.keys():
+ for param_list in aggregate[name]["param"]:
+ for param_index in range(len(param_list)):
+ param_list[param_index] = param_shift_function(
+ param_list[param_index]
+ )
+ else:
+ param_index = parameters.index(param_name)
+ for name in aggregate.keys():
+ for param_list in aggregate[name]["param"]:
+ if param_list[param_index] is not None:
+ param_list[param_index] = param_shift_function(
+ param_list[param_index]
+ )
def filter_aggregate_by_param(aggregate, parameters, parameter_filter):