Skip to content
Snippets Groups Projects
Commit 8b6fa28d authored by Philipp Schmidt's avatar Philipp Schmidt
Browse files

Minor text, comment and code formatting improvements

parent 5f8cdf9d
No related branches found
No related tags found
No related merge requests found
...@@ -199,7 +199,8 @@ class AgipdGain(ReductionMethod): ...@@ -199,7 +199,8 @@ class AgipdGain(ReductionMethod):
'explicit gain sources') 'explicit gain sources')
return 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' agipd_sources = f'{domain}/DET/*CH0:xtdf'
else: else:
...@@ -214,6 +215,8 @@ class AgipdGain(ReductionMethod): ...@@ -214,6 +215,8 @@ class AgipdGain(ReductionMethod):
# Unfortunately HED uses a different domain for # Unfortunately HED uses a different domain for
# its AGIPD control devices, hardcode it here # its AGIPD control devices, hardcode it here
# for convenience. # for convenience.
# TODO: This could also be solved via a CalCat
# query.
domain = domain.replace('_DET_', '_EXP_') domain = domain.replace('_DET_', '_EXP_')
control_source = f'{domain}/MDL/FPGA_COMP' control_source = f'{domain}/MDL/FPGA_COMP'
......
...@@ -31,8 +31,8 @@ def apply_by_key(op_name): ...@@ -31,8 +31,8 @@ def apply_by_key(op_name):
def op_handler(self): def op_handler(self):
for source_glob, key_glob, *args in self._filter_ops(op_name): for source_glob, key_glob, *args in self._filter_ops(op_name):
for source in fnmatch.filter(self._sources, source_glob): for source in fnmatch.filter(self._sources, source_glob):
keys = self._custom_keys.get(source, keys = self._custom_keys.get(
set(self._data[source].keys())) source, set(self._data[source].keys()))
for key in fnmatch.filter(keys, key_glob): for key in fnmatch.filter(keys, key_glob):
op_func(source, key, *args) op_func(source, key, *args)
...@@ -82,8 +82,8 @@ class ReduceWriter(SourceDataWriter): ...@@ -82,8 +82,8 @@ class ReduceWriter(SourceDataWriter):
self._ops = sum(methods.values(), []) self._ops = sum(methods.values(), [])
if not self._ops: if not self._ops:
self.log.warning('Sum of reduction methods yielded no operations ' self.log.warning('Sum of reduction methods yielded '
'to apply') 'no operations to apply')
self._sources = sorted(data.all_sources) self._sources = sorted(data.all_sources)
self._touched_sources = set() self._touched_sources = set()
...@@ -117,7 +117,6 @@ class ReduceWriter(SourceDataWriter): ...@@ -117,7 +117,6 @@ class ReduceWriter(SourceDataWriter):
'Source may not be affected by both select-entries and ' 'Source may not be affected by both select-entries and '
'select-xtdf operations') 'select-xtdf operations')
if self._rechunked_keys.keys() & self._compressed_keys.keys(): if self._rechunked_keys.keys() & self._compressed_keys.keys():
raise ReduceMethodError('Key may not be affected by both ' raise ReduceMethodError('Key may not be affected by both '
'compress-keys and rechunk-keys') 'compress-keys and rechunk-keys')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment