diff --git a/lindi/LindiH5pyFile/LindiH5pyDataset.py b/lindi/LindiH5pyFile/LindiH5pyDataset.py index 5973739..598279a 100644 --- a/lindi/LindiH5pyFile/LindiH5pyDataset.py +++ b/lindi/LindiH5pyFile/LindiH5pyDataset.py @@ -38,6 +38,8 @@ def __init__(self, _dataset_object: Union[h5py.Dataset, zarr.Array], _file: "Lin compound_dtype_obj = _dataset_object.attrs.get("_COMPOUND_DTYPE", None) if compound_dtype_obj is not None: assert isinstance(compound_dtype_obj, list) + # compound_dtype_obj is a list of tuples (name, dtype) + # where dtype == "" if it represents an HDF5 reference for i in range(len(compound_dtype_obj)): if compound_dtype_obj[i][1] == '': compound_dtype_obj[i][1] = h5py.special_dtype(ref=h5py.Reference) diff --git a/lindi/LindiH5pyFile/LindiH5pyFile.py b/lindi/LindiH5pyFile/LindiH5pyFile.py index afe0498..eba0e81 100644 --- a/lindi/LindiH5pyFile/LindiH5pyFile.py +++ b/lindi/LindiH5pyFile/LindiH5pyFile.py @@ -42,7 +42,7 @@ def from_reference_file_system(rfs: Union[dict, str], mode: Literal["r", "r+"] = path), the file itself will not be modified on changes, but the internal in-memory representation will be modified. Use to_reference_file_system() to export the updated reference file - system. + system to the same file or a new file. """ if isinstance(rfs, str): if rfs.startswith("http") or rfs.startswith("https"): diff --git a/lindi/LindiH5pyFile/LindiH5pyGroup.py b/lindi/LindiH5pyFile/LindiH5pyGroup.py index 89d303f..e9f430d 100644 --- a/lindi/LindiH5pyFile/LindiH5pyGroup.py +++ b/lindi/LindiH5pyFile/LindiH5pyGroup.py @@ -58,7 +58,7 @@ def __getitem__(self, name): if soft_link is not None: link_path = soft_link['path'] target_item = self._file.get(link_path) - if not isinstance(target_item, LindiH5pyGroup) and not isinstance(target_item, LindiH5pyDataset): + if not isinstance(target_item, (LindiH5pyGroup, LindiH5pyDataset)): raise Exception( f"Expected a group or dataset at {link_path} but got {type(target_item)}" )