-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Backends descriptions #7200
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
Backends descriptions #7200
Conversation
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.
Great!
@@ -353,6 +353,8 @@ def close(self, **kwargs): | |||
|
|||
class H5netcdfBackendEntrypoint(BackendEntrypoint): | |||
available = has_h5netcdf | |||
description = "Open netCDF files (.nc, .nc4 and .cdf) using h5netcdf in Xarray" | |||
url = "https://docs.xarray.dev/en/stable/generated/xarray.backends.H5netcdfBackendEntrypoint.html" |
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.
Interesting idea. I wonder whether these should be in docstrings then be linked by Sphinx, vs. in code. But ofc fine to try from my perspective.
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.
Just one comment here, h5netcdf
(and netcdf4
) can also open hdf5 files which are not strict NetCDF4. Not sure how to better phrase this, though.
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.
Interesting idea. I wonder whether these should be in docstrings then be linked by Sphinx, vs. in code. But ofc fine to try from my perspective.
No idea how that would work, could you give an example?
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.
Just one comment here,
h5netcdf
(andnetcdf4
) can also open hdf5 files which are not strict NetCDF4. Not sure how to better phrase this, though.
Should ".h5" be added to guess_can_open
?
Or you don't want to specify this because not strict netCDF files might not work with xarray?
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.
Should ".h5" be added to
guess_can_open
?
I'd say that this is not necessary. Those who want to open will use the engine-kwarg.
There are only a few hdf5-specifics which can't be read by netcdf4
(see https://h5netcdf.org/#invalid-netcdf-files, list might not be up-to-date as netcdf-c is evolving too). So xarray is able digest most normal hdf5-files (via netcdf4
and h5netcdf
).
My concern is, that users might conclude that only netCDF4-files are readable and get confused. Good chance that my impression will not hold and users know what they are doing.
Anyway, I really like these enhancements to the backends.
If one wants to get fancy, we could wrap the |
Whilst I don't want to discourage eager devs, in one of the community calls we did discuss how this would almost certainly be overkill for a little-used advanced feature. |
Since the url points to our internal documentation I assume it would be beneficial to add some docstrings to the Entrypoint classes? |
whats-new.rst
api.rst