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

Committed datatypes #80

Closed
axelboc opened this issue Aug 22, 2024 · 8 comments
Closed

Committed datatypes #80

axelboc opened this issue Aug 22, 2024 · 8 comments

Comments

@axelboc
Copy link
Collaborator

axelboc commented Aug 22, 2024

We've just had a request in the vscode-h5web extension to support JLD2 files: silx-kit/vscode-h5web#46.

The problem is that these files make heavy use of committed datatypes — i.e. datatypes that are defined and stored as their own entities so they can potentially be referenced by multiple datasets.

Currently, h5wasm fails at reading the metadata of such datatypes. To reproduce, select the datatypes group in the epic.h5 file in H5Web's h5wasm demo (vs in the h5grove demo).

I've opened an issue in the H5Web repo to track this as well: silx-kit/h5web#1699

@bmaranville
Copy link
Member

I can see in the source that we make no attempt to read metadata from Datatype objects at the moment, but I'm confused why there is an error in h5web when opening the datatypes group - it should just return 3 opaque Datatype objects, not try to open them as datasets, right?

@axelboc
Copy link
Collaborator Author

axelboc commented Aug 26, 2024

Indeed, likely due to a copy-pasting oversight when implementing the worker, I was calling get_dataset_metadata(fileId, path) for datatypes... https://github.com/silx-kit/h5web/blob/main/packages/h5wasm/src/worker-utils.ts#L149-L160

Commenting out the line reveals another error when trying to read attributes, on this line: https://github.com/usnistgov/h5wasm/blob/main/src/hdf5_util.cc#L226. I assume one needs to call H5Tget_create_plist when obj_type is a datatype.

@axelboc
Copy link
Collaborator Author

axelboc commented Aug 26, 2024

Contrary to what I thought, it seems that there's no problem reading the metadata of dataset that points to a committed datatype. This means that #81 will likely be sufficient to fully support committed datatypes. I'll update the issue in H5Web.

@bmaranville
Copy link
Member

Datatype.metadata getter is in v0.7.7, just released through npm

@axelboc
Copy link
Collaborator Author

axelboc commented Aug 29, 2024

Commenting out the line reveals another error when trying to read attributes, on this line: https://github.com/usnistgov/h5wasm/blob/main/src/hdf5_util.cc#L226. I assume one needs to call H5Tget_create_plist when obj_type is a datatype.

I forgot to address this, sorry. I'll open a PR with a fix.

@bmaranville
Copy link
Member

Can datatypes have attributes? I didn't think that was possible.

@bmaranville
Copy link
Member

You're right - it mentions here the types of objects that can have attributes, and it's groups, datasets and named datatypes: https://docs.hdfgroup.org/archive/support/HDF5/doc/RM/RM_H5A.html#Annot-Iterate2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants