Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
 into write
  • Loading branch information
magland committed Apr 4, 2024
2 parents 08e683f + e4312e7 commit fd0643c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions lindi/LindiH5pyFile/LindiH5pyDataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 == "<REFERENCE>" if it represents an HDF5 reference
for i in range(len(compound_dtype_obj)):
if compound_dtype_obj[i][1] == '<REFERENCE>':
compound_dtype_obj[i][1] = h5py.special_dtype(ref=h5py.Reference)
Expand Down
2 changes: 1 addition & 1 deletion lindi/LindiH5pyFile/LindiH5pyFile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"):
Expand Down
2 changes: 1 addition & 1 deletion lindi/LindiH5pyFile/LindiH5pyGroup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)}"
)
Expand Down

0 comments on commit fd0643c

Please sign in to comment.