Skip to content

Commit

Permalink
Merge pull request #38 from tedhabermann/main
Browse files Browse the repository at this point in the history
Improved error messages
  • Loading branch information
martindurant authored Jul 6, 2021
2 parents 67ccf71 + cf5030e commit 97f210f
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions fsspec_reference_maker/hdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,10 +154,18 @@ 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')):
#
# check for unsupported HDF encoding/filters
#
if h5obj.scaleoffset:
raise RuntimeError(
f'{h5obj.name} uses unsupported HDF5 filters')
f'{h5obj.name} uses HDF5 scaleoffset filter - not supported by reference-maker')
if h5obj.fletcher32:
raise RuntimeError(
f'{h5obj.name} uses fletcher32 checksum - not supported by reference-maker')
if h5obj.compression in ('szip', 'lzf'):
raise RuntimeError(
f'{h5obj.name} uses szip or lzf compression - not supported by reference-maker')
if h5obj.compression == 'gzip':
compression = numcodecs.Zlib(level=h5obj.compression_opts)
else:
Expand Down

0 comments on commit 97f210f

Please sign in to comment.