-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[Feature] Backend entrypoint #3166
Closed
Closed
Conversation
This file contains 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
This was referenced Apr 7, 2020
@jhamman & @shoyer the refactor of the big If you don't mind I'll ask @TheRed86 to open a PR for this refactor alone. |
5 tasks
jhamman
pushed a commit
that referenced
this pull request
Sep 24, 2020
…e: backend_open}. (#4431) * Add docs re stable branch (#4444) * Add docs re stable branch * Update HOW_TO_RELEASE.md Co-authored-by: keewis <[email protected]> Co-authored-by: keewis <[email protected]> * Port engine selection refactor from #3166 and add zarr * Always add `mode="r"` to zarr and simplify logic Co-authored-by: Maximilian Roos <[email protected]> Co-authored-by: keewis <[email protected]> Co-authored-by: Monica Rossetti <[email protected]>
closed by #4577 |
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.
In this PR, I'm experimenting with using the entrypoints package to support 3rd party backends. This does not attempt to solidify the API for what the store is, I feel like that should happen in a second PR. Here's how it would work...
In @rabernat's
xmitgcm
package, there is a_MDSDataStore
that inherits fromxarray.backends.common.AbstractDataStore
. To allow readingmds
datasets directly inxarray.open_dataset
,xmitgcm
would add the following lines to itssetup.py
file:Xarray would then be able to discover this backend at runtime and users could use the store directly in
open_dataset
calls like this:Note: I recognize that
xmitgcm.open_mdsdataset
has a bunch of other user options that I'm likely ignoring here but this is meant just as an illustration.Now a list of caveats and things to consider:
open_dataset
, not forto_netcdf
. We may want to consider more generic serialization method that allows for plug-able writers.open_dataset
has some special handling for some readers (lock and group selection, file-like objects, etc.). We should work toward moving as much of that logic into the Store objects as possible.netcdf4
.whats-new.rst
for all changes andapi.rst
for new API