-
-
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
DRAFT: Implement open_datatree
in BackendEntrypoint for preliminary DataTree support
#7437
Closed
Closed
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
cb0ca37
Initial API placeholder for open_datatree in backend
jthielen 39ba056
Attempt to add datatree open to backend (for netcdf and abstract)
jthielen 77129f1
Add top-level open_datatree function (TODO: deduplicate and clean up …
jthielen 040f3e0
remove debug line
jthielen e9e0ded
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 9d64b36
Merge branch 'main' into datatree-backend
TomNicholas File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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 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 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
Oops, something went wrong.
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.
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.
I wonder if, instead of making
open_datatree
optional, it would be possible to expose a separate entrypoint?My motivation is a composite backend where a
Dataset
entrypoint would not make sense (I'm usingopen_dataset
to open several netcdf files and arrange them in a hierarchy encoded in the file names).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.
@keewis My instinct is that a separate entrypoint would give a messier API (would we need three entrypoints for each combination of datatree and/or dataset implementation, each subclassed from a private base class?). Perhaps there would be a clever way to just have at least one of
open_datatree
oropen_dataset
required, so a single entrypoint (i.e., the existingBackendEntrypoint
) could handle every combination?(Note, I haven't revisited this code since the initial draft, so I very well might be under mistaken impressions relative to the current state of the codebase!)
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.
Seems possible, see #7460 (comment)
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.
the idea I had was that you'd have two entirely separate entrypoints (as in, package metadata entrypoints that can be registered against), one for
Dataset
/DataArray
and one forDataTree
. The advantage would be to keep both entirely separate, so we wouldn't have a need foropen_dataset_parameters
andopen_datatree_parameters
.However, that might make it a bit confusing since it would allow two different packages to register entrypoints under the same name, so I won't insist on it (which may or may not be intentional). Plus, keeping the functions in a single
BackendEntrypoint
makes raising helpful error messages a bit easier.(And, one might argue that given any of the functions it is possible to implement the others, although it might not be the most efficient way to implement them)