Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork1.2k
Group Backend Keyword Arguments#10422
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Please have a look at#10429, where I've split out the cf coder related kwargs grouping. |
To summarize what I argued for after the end of the meeting today, I think we should slowly transition to an API where we pass the entire decoding chain as a sequence of functions / callable objects into This would requirea lot of thought to figure out a good API, and even more to find a good way to transition towards that. I think this would make extending the coders a lot easier, and possibly pave the way towards dataset coders (or rather, multi-variable coders). I think it might be possible to change the dataclass added in this PR to act as a bridge towards the idea in#4490 (comment) (which should probably be extended to allow other libraries / backends to modify that chain). |
whats-new.rst
api.rst
This is a first attempt and base for discussion.
This PR does the following:
open_dataset
kwargs into four groups:Here I followed@shoyer's suggestion to use dataclassesGroup together decoding options into a single argument #4490.
BackendEntrypoint
and override them in the subclasses.for now only for netcdf4/h5netcdf backends
open_dataset
to_netcdf
Example usage:
CONS:
PROS:
What this PR still needs to do:
I have follow-up ideas:
implement
save_dataset
inBackendEntrypoint
to write to the engine's native format, liketo_netcdf
would be for scipy/netcdf4/h5netcdf andto_zarr
would be for zarr. With that we could do the writing with a unified API, something like:further disentangle the current built-in backends from xarray so that they could be their own module
I'm sure I have not taken into account all the possible pitfalls/problems which might arise here. I'd appreciate any comments and suggestions.