diff --git a/src/cal_tools/calcat_interface2.py b/src/cal_tools/calcat_interface2.py index 084f194b0951754854f805f4746b25d7c3d3d4da..a2af181460c37e2210cd706ec83cba61d2b23afb 100644 --- a/src/cal_tools/calcat_interface2.py +++ b/src/cal_tools/calcat_interface2.py @@ -524,20 +524,6 @@ class CalibrationData(Mapping): mods.intersection_update(self[cal_type].constants) return self.select_modules(aggregator_names=mods) - def select_calibrations(self, calibrations, require_all=True): - if require_all: - missing = set(calibrations) - set(self.constant_groups) - if missing: - raise KeyError(f"Missing calibrations: {', '.join(sorted(missing))}") - - d = { - cal_type: mcv.constants - for (cal_type, mcv) in self.constant_groups.items() - if cal_type in calibrations - } - # TODO: missing for some modules? - return type(self)(d, self.aggregators) - def select_modules( self, module_nums=None, *, aggregator_names=None, qm_names=None ) -> "CalibrationData": @@ -570,28 +556,6 @@ class CalibrationData(Mapping): return type(self)(d, sorted(aggregators)) - def load_all(self, caldb_root=None): - res = {} - - const_load_mp = psh.ProcessContext(num_workers=24) - keys = [] - for cal_type, mcv in self.constant_groups.items(): - res[cal_type] = {} - for module in mcv.aggregators: - dset = mcv.constants[module].dataset_obj(caldb_root) - res[cal_type][module] = const_load_mp.alloc( - shape=dset.shape, dtype=dset.dtype - ) - keys.append((cal_type, module)) - - def _load_constant_dataset(wid, index, key): - cal_type, mod = key - dset = self[cal_type].constants[mod].dataset_obj(caldb_root) - dset.read_direct(res[cal_type][mod]) - - const_load_mp.map(_load_constant_dataset, keys) - return res - class ConditionsBase: calibration_types = {} # For subclasses: {calibration: [parameter names]}