Commit e9c4bb5a authored by Tomas Farago's avatar Tomas Farago
Browse files

improve log message

parent fa0d27b5
Pipeline #33158 passed with stage
in 22 seconds
......@@ -580,7 +580,7 @@ def h5_to_nx(input_file_path: str, output_file: str, single_file:bool,
progress.set_max_advancement(len(acquisitions))
for i_acquisition, acquisition in enumerate(acquisitions):
if entries is not None and acquisition.initialization_entry.name not in entries:
_logger.info('skip entry ' + acquisition.initialization_entry.name)
# _logger.info('skip entry ' + acquisition.initialization_entry.name)
continue
if single_file:
en_output_file = output_file
......@@ -1017,15 +1017,22 @@ class _Acquisition:
keys: typing.Iterable, info_retrieve,
expected_unit):
def get_values():
def get_key_used():
for possible_key in keys:
if possible_key in node:
values = node[possible_key][()]
unit = _Acquisition._get_unit(node[possible_key],
default_unit=expected_unit)
return values, unit
return possible_key
return None
def get_values():
key = get_key_used()
if key is None:
return None, None
else:
values = node[key][()]
unit = _Acquisition._get_unit(node[key],
default_unit=expected_unit)
return values, unit
return None, None
values, unit = get_values()
if values is None:
raise ValueError('Unable to retrieve %s for %s' % (info_retrieve, node.name))
......@@ -1046,7 +1053,7 @@ class _Acquisition:
return values[:-1].tolist(), unit
else:
raise ValueError('incoherent number of angle position compare to '
'the number of frame')
'the number of frame from key {}'.format(get_key_used()))
def _write_beam(self, root_node, request_input, input_callback):
beam_node = root_node.create_group('beam')
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment