-
Notifications
You must be signed in to change notification settings - Fork 2.9k
HDF5 support #7690
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
HDF5 support #7690
Conversation
A few to-dos which I think can be left for future PRs (which I am happy to do/help with -- just this one is already huge 😄 ):
|
@lhoestq any interest in merging this? Let me know if I can do anything to make reviewing it easier! |
Sorry for the delay, I'll review your PR soon :) |
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great ! I left a few comments :)
Btw feel free to run make style
to fix code formatting
features = {} | ||
for field_name in field_names: | ||
field_dtype = dset.dtype[field_name] | ||
field_path = f"{base_path}_{field_name}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe it should create nested features like this instead ?
Features({
"position": {
"x": List(Value("int64")),
"y": List(Value("int64")),
},
"veolocity": {
"vx": List(Value("int64")),
"vy": List(Value("int64")),
},
})
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does db2e76a look good? I'm not sure it will be as fast as the separate columns but it does clean up the collision checks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good ! btw with ds = ds.flatten()
you can get a flat structure with columns named "position.x"
, "position.y"
etc.
Thanks for the review @lhoestq! Rebased on main and incorporated most of your suggestions. I believe the only one left is the zero-dim handling with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yay ! LGTM :)
Let's document this now, this is big !
Would you like to to open a PR for the docs ?
also cc @georgiachanning for viz
Awesome! Yes, I'm happy to help with the docs. Would appreciate any pointers, we can discuss in #7740. It does look like there was a CI test failure, though it seems unrelated?
Also, what do you think of the todos in #7690 (comment) ? In particular I think support in dataset-viewer would be nice. |
Cool ! Yeah the failure is unrelated Regarding the Viewer, it should work out of the box when it's updated with the next version of |
This PR adds support for tabular HDF5 file(s) by converting each row to an Arrow table. It supports columns with the usual dtypes including up to 5-dimensional arrays as well as support for complex/compound types by using
Features(dict)
. All datasets within the HDF5 file should have rows on the first dimension (groups/subgroups are still allowed). Closes #3113.Replaces #7625 which only supports a relatively small subset of HDF5.