From 531bf38c4334a986fc77f126ce39fd98b32a0049 Mon Sep 17 00:00:00 2001 From: Martin Durant Date: Fri, 25 Jun 2021 12:24:42 -0400 Subject: [PATCH] Allow datasets with fletcher32 checksum --- fsspec_reference_maker/hdf.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fsspec_reference_maker/hdf.py b/fsspec_reference_maker/hdf.py index cc60820a..cf7534e1 100644 --- a/fsspec_reference_maker/hdf.py +++ b/fsspec_reference_maker/hdf.py @@ -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):