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

Fix three bugs from past refactoring that went unnoticed

parent e082a666
No related branches found
No related tags found
1 merge request!15Fix bugs from past refactoring that went unnoticed
......@@ -18,6 +18,7 @@ from ..write.datafile import write_compressed_frames
import h5py
from extra_data.sourcedata import SourceData
def _SourceData_get_index_group_sample(self, index_group):
if self.is_control and not index_group:
# Shortcut for CONTROL data.
......@@ -32,6 +33,7 @@ def _SourceData_get_index_group_sample(self, index_group):
for f in self.files:
return f.file[group].visititems(get_key)
SourceData._get_index_group_sample = _SourceData_get_index_group_sample
......@@ -98,7 +100,7 @@ class ReduceWriter(SourceDataWriter):
elif input_version == Version('1.2') and data.control_sources:
# Check for mislabeled EXDF-v1.3 files.
ctrl_src = next(iter(control_sources))
ctrl_src = next(iter(data.control_sources))
if data[ctrl_src, ctrl_src.one_key()].attributes():
input_version = Version('1.3')
......
......@@ -303,10 +303,11 @@ class SourceDataWriter:
# Copy INSTRUMENT data.
for sd in sources:
h5source = f.source[sd.source]
start_source = perf_counter()
h5source = f.source[sd.source]
keys = sd.keys()
for index_group in sd.index_groups:
mask = masks.get(index_group, np.s_[:])
......@@ -503,8 +504,9 @@ def get_key_attributes(sd):
if not same_keys or not same_values:
log.debug(f'Attributes for {sd.source}.{path} in '
f'{source_file} are {path_attrs}, but got '
f'{source_attrs[path]} from previous file')
f'{basename(fa.filename)} are {path_attrs}, '
f'but got {source_attrs[path]} from '
f'previous file')
raise ValueError(f'attribute mismatch on '
f'{sd.source}.{path}')
......
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