From 8b6fa28d8a1e4818a7a5a814e0d683515d733075 Mon Sep 17 00:00:00 2001 From: Philipp Schmidt <philipp.schmidt@xfel.eu> Date: Fri, 15 Dec 2023 16:02:34 +0100 Subject: [PATCH] Minor text, comment and code formatting improvements --- src/exdf/data_reduction/builtins.py | 5 ++++- src/exdf/data_reduction/writer.py | 9 ++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/exdf/data_reduction/builtins.py b/src/exdf/data_reduction/builtins.py index a9f3e88..965f401 100644 --- a/src/exdf/data_reduction/builtins.py +++ b/src/exdf/data_reduction/builtins.py @@ -199,7 +199,8 @@ class AgipdGain(ReductionMethod): 'explicit gain sources') return - self.log.info(f'Found {domain}') + self.log.info(f'No detector specified, detected {domain} ' + f'automatically') agipd_sources = f'{domain}/DET/*CH0:xtdf' else: @@ -214,6 +215,8 @@ class AgipdGain(ReductionMethod): # Unfortunately HED uses a different domain for # its AGIPD control devices, hardcode it here # for convenience. + # TODO: This could also be solved via a CalCat + # query. domain = domain.replace('_DET_', '_EXP_') control_source = f'{domain}/MDL/FPGA_COMP' diff --git a/src/exdf/data_reduction/writer.py b/src/exdf/data_reduction/writer.py index e095fbd..33b6d94 100644 --- a/src/exdf/data_reduction/writer.py +++ b/src/exdf/data_reduction/writer.py @@ -31,8 +31,8 @@ def apply_by_key(op_name): def op_handler(self): for source_glob, key_glob, *args in self._filter_ops(op_name): for source in fnmatch.filter(self._sources, source_glob): - keys = self._custom_keys.get(source, - set(self._data[source].keys())) + keys = self._custom_keys.get( + source, set(self._data[source].keys())) for key in fnmatch.filter(keys, key_glob): op_func(source, key, *args) @@ -82,8 +82,8 @@ class ReduceWriter(SourceDataWriter): self._ops = sum(methods.values(), []) if not self._ops: - self.log.warning('Sum of reduction methods yielded no operations ' - 'to apply') + self.log.warning('Sum of reduction methods yielded ' + 'no operations to apply') self._sources = sorted(data.all_sources) self._touched_sources = set() @@ -117,7 +117,6 @@ class ReduceWriter(SourceDataWriter): 'Source may not be affected by both select-entries and ' 'select-xtdf operations') - if self._rechunked_keys.keys() & self._compressed_keys.keys(): raise ReduceMethodError('Key may not be affected by both ' 'compress-keys and rechunk-keys') -- GitLab