diff options
author | Birte Kristina Friesel <birte.friesel@uos.de> | 2025-03-20 14:21:11 +0100 |
---|---|---|
committer | Birte Kristina Friesel <birte.friesel@uos.de> | 2025-03-20 14:21:11 +0100 |
commit | 192dc253d9c576d2b2bfffce6cc645b695ab1e77 (patch) | |
tree | 50488bd58bbdedb08d414947391c58394993cf63 /lib/utils.py | |
parent | 5872348e31cc4698c2bb976662df5efac4467cae (diff) |
workload: Support LUT lookups
Diffstat (limited to 'lib/utils.py')
-rw-r--r-- | lib/utils.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/utils.py b/lib/utils.py index 208db44..228e78c 100644 --- a/lib/utils.py +++ b/lib/utils.py @@ -207,6 +207,18 @@ def param_slice_eq(a, b, index): return False +def param_eq_or_none(a, b): + """ + Check if by_param keys a and b are identical, allowing a None in a to match any key in b. + """ + set_keys = tuple(filter(lambda i: a[i] is not None, range(len(a)))) + a_not_none = tuple(map(lambda i: a[i], set_keys)) + b_not_none = tuple(map(lambda i: b[i], set_keys)) + if a_not_none == b_not_none: + return True + return False + + def match_parameter_values(input_param: dict, match_param: dict): """ Check whether one of the paramaters in `input_param` has the same value in `match_param`. |