feat(hdf5): add native HDF5 file type - #1955
Draft
yathomasi wants to merge 1 commit into
Draft
Conversation
- Hdf5File streams file handle, fetches dataset/slice without full read (h5py: read/seek/tell via FileWrapper) - Hdf5Dataset columns: shape, chunks, dtype, attrs for pushdown; Hdf5Selection = lazy region, becomes image bytes for preview - cast h5py attrs (ndarray, np scalar, bytes) to Python for JSON column - access: read_storage(type="hdf5") or File.as_hdf5_file(); no extra reader (HDF5 = one object) - models not re-exported, so import datachain skips h5py (like zarr) - optional [hdf5] extra; no version gate, h5py wheels 3.10-3.14 - implements #1909
Deploying datachain with
|
| Latest commit: |
faa399f
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://b6743678.datachain-2g6.pages.dev |
| Branch Preview URL: | https://yathomasi-1909-hdf5-file-typ.datachain-2g6.pages.dev |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a native HDF5 type so datasets can be inspected and sliced through DataChain without reading the whole file in a generator. Mirrors Zarr: metadata as columns for pushdown, plus a lazy region handle for later reads / image preview.
Details
Hdf5File(Filesubclass) opened viaread_storage(..., type="hdf5")orFile.as_hdf5_file();h5pyuses the existing streaming handle (read/seek/tell)Hdf5Datasetexposesshape,chunks,dtype,attrs;Hdf5Selectionis a lazy slice materialized withread()/read_bytes()(PNG for Studio)datachain.lib.hdf5and are not re-exported, soimport datachaindoes not loadh5py(same pattern as Zarr)pip install 'datachain[hdf5]'(h5py>=3.11)Out of scope: NetCDF4 / LeRobot layouts (files still load as plain HDF5); no
read_hdf5()reader (one file = one object); Will follow up on studio preview wiring.