Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added check for HDF5 datasets with type = object #46

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -124,3 +124,4 @@ dmypy.json
# Pyre type checker
.pyre/

.DS_Store
20 changes: 20 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Make References",
"type": "python",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal",
"args": [
"-if",
"TEST00USA_R_20203370000_01D_15S_MO.rnx.nc"
],
"cwd": "/Users/metadatagamechanger/data/UNAVCO/rinexData/p226/testData"
}
]
}
13 changes: 10 additions & 3 deletions fsspec_reference_maker/hdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@

lggr = logging.getLogger('h5-to-zarr')


class SingleHdf5ToZarr:
"""Translate the content of one HDF5 file into Zarr metadata.

Expand Down Expand Up @@ -147,13 +146,21 @@ def _translator(self, name: str, h5obj: Union[h5py.Dataset, h5py.Group]):
"""
refs = {}
if isinstance(h5obj, h5py.Dataset):
lggr.debug(f'HDF5 dataset: {h5obj.name}')
lggr.debug(f'HDF5 dataset: {h5obj.name} dataType: {h5obj.dtype}')
if h5obj.id.get_create_plist().get_layout() == h5py.h5d.COMPACT:
RuntimeError(
f'Compact HDF5 datasets not yet supported: <{h5obj.name} '
f'{h5obj.shape} {h5obj.dtype} {h5obj.nbytes} bytes>')
return

#
# check for unsupported HDF DataTypes
#
if h5obj.dtype == 'object':
lggr.warning(f'HDF5 variable length strings are not yet supported: <{h5obj.name} ')
lggr.warning(f'shape: {h5obj.shape} type: {h5obj.dtype} bytes: {h5obj.nbytes} bytes>')
RuntimeError(
f'{h5obj.shape} {h5obj.dtype} {h5obj.nbytes} bytes>')
return
#
# check for unsupported HDF encoding/filters
#
Expand Down