From 8ef28f7247b1aa99eaeba96942d40389124b62e7 Mon Sep 17 00:00:00 2001
From: Thomas Kluyver <thomas@kluyver.me.uk>
Date: Tue, 1 Aug 2023 17:22:12 +0100
Subject: [PATCH] Some fixes

---
 src/cal_tools/calcat_interface2.py | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/cal_tools/calcat_interface2.py b/src/cal_tools/calcat_interface2.py
index 5101cc4d9..6595057c0 100644
--- a/src/cal_tools/calcat_interface2.py
+++ b/src/cal_tools/calcat_interface2.py
@@ -98,7 +98,8 @@ class CalibrationData(Mapping):
 
     def __init__(self, constant_groups: Dict[str, Dict[str, SingleConstantVersion]]):
         self.constant_groups = {
-            const_type: ModulesConstantVersions(d) for const_type, d in constant_groups
+            const_type: ModulesConstantVersions(d)
+            for const_type, d in constant_groups.items()
         }
 
     @classmethod
@@ -106,7 +107,7 @@ class CalibrationData(Mapping):
         cls,
         condition: "ConditionsBase",
         detector_name,
-        modules: Optional[Sequence[str]]=None,
+        modules: Optional[Sequence[str]] = None,
         calibrations=None,
         client=None,
         event_at=None,
@@ -118,7 +119,7 @@ class CalibrationData(Mapping):
         cal_types_by_params_used = {}
         for cal_type, params in condition.calibration_types.items():
             if cal_type in calibrations:
-                cal_types_by_params_used.setdefault(params, []).append(cal_type)
+                cal_types_by_params_used.setdefault(tuple(params), []).append(cal_type)
 
         api = CalCatApi(client or get_client())
 
@@ -137,7 +138,7 @@ class CalibrationData(Mapping):
                 detector_name,
                 calibration_ids,
                 condition_dict,
-                modules[0] if len(modules) == 1 else '',
+                modules[0] if len(modules) == 1 else "",
                 event_at,
                 pdu_snapshot_at or event_at,
             )
-- 
GitLab