Skip to content

Commit

Permalink
Allow datasets with fletcher32 checksum
Browse files Browse the repository at this point in the history
Martin Durant committed Jun 25, 2021
1 parent c2e95b3 commit 531bf38
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions fsspec_reference_maker/hdf.py
Original file line number Diff line number Diff line change
@@ -154,8 +154,7 @@ def _translator(self, name: str, h5obj: Union[h5py.Dataset, h5py.Group]):
f'{h5obj.shape} {h5obj.dtype} {h5obj.nbytes} bytes>')
return

if (h5obj.scaleoffset or h5obj.fletcher32 or
h5obj.compression in ('szip', 'lzf')):
if (h5obj.scaleoffset or h5obj.compression in ('szip', 'lzf')):
raise RuntimeError(
f'{h5obj.name} uses unsupported HDF5 filters')
if h5obj.compression == 'gzip':
@@ -191,6 +190,8 @@ def _translator(self, name: str, h5obj: Union[h5py.Dataset, h5py.Group]):
# Store chunk location metadata...
if cinfo:
for k, v in cinfo.items():
if h5obj.fletcher32:
v['size'] -= 4
self.store[za._chunk_key(k)] = [self._uri, v['offset'], v['size']]

elif isinstance(h5obj, h5py.Group):

0 comments on commit 531bf38

Please sign in to comment.