From 3574282c2b6fa669382828011df3a9bfd804a29b Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Tue, 13 Jun 2023 13:31:47 +0200 Subject: add --normalize-nfp support (e.g. for MBps -> Bps) --- lib/utils.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'lib/utils.py') diff --git a/lib/utils.py b/lib/utils.py index 5b40f51..ed5aa14 100644 --- a/lib/utils.py +++ b/lib/utils.py @@ -447,6 +447,15 @@ def by_param_to_by_name(by_param: dict) -> dict: return by_name +def normalize_nfp_in_aggregate(aggregate, nfp_norm): + for name in aggregate.keys(): + for new_name, old_name, norm_function in nfp_norm: + if old_name in aggregate[name]["attributes"]: + aggregate[name][new_name] = norm_function(aggregate[name].pop(old_name)) + aggregate[name]["attributes"].remove(old_name) + aggregate[name]["attributes"].append(new_name) + + def shift_param_in_aggregate(aggregate, parameters, parameter_shift): """ Remove entries which do not have certain parameter values from `aggregate`. -- cgit v1.2.3