-
Notifications
You must be signed in to change notification settings - Fork 107
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
Variables as an independent class #451
Merged
Merged
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
Co-authored-by: Wei Ji <[email protected]>
Co-authored-by: Jessica Scheick <[email protected]>
JessicaS11
reviewed
Oct 30, 2023
JessicaS11
reviewed
Oct 30, 2023
JessicaS11
reviewed
Oct 30, 2023
Co-authored-by: Jessica Scheick <[email protected]>
JessicaS11
reviewed
Nov 2, 2023
JessicaS11
reviewed
Nov 3, 2023
Co-authored-by: Jessica Scheick <[email protected]>
JessicaS11
reviewed
Nov 6, 2023
JessicaS11
approved these changes
Nov 6, 2023
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.
Thanks for all the tremendous work on this, @rwegener2!
Co-authored-by: Jessica Scheick <[email protected]>
JessicaS11
pushed a commit
that referenced
this pull request
Nov 15, 2023
Refactor Variables class to be user facing functionality
JessicaS11
pushed a commit
that referenced
this pull request
Jan 5, 2024
Refactor Variables class to be user facing functionality
JessicaS11
added a commit
that referenced
this pull request
Jan 5, 2024
This reverts commit fb28038.
2 tasks
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.
Goal
The ability to list the available variables and their h5 paths is a unique and powerful feature of icepyx. This PR aims to make that first-order functionality, instead of functionality that is only used internally. I think this will be a useful user feature, and I think it makes sense to make this change before adding the s3 url capability.
How it was done
We anticipate that the most common use case is reading variables from a file. Alternately, all you need to produce an
.avail()
list of variables is a product and version. This information is used to ping an API, which returns the variables.When using
Variables()
the user is required to supply EITHER:The version argument is optional. If it is not supplied the latest version is assumed. If both
path
andproduct
is given an error is raised.How it can be tested (updated)
And testing that Read and Query still work:
Notes
var_list
is appended to the wanted variables list (vars.wanted
) duringload
. Ifvars.wanted
does not exist an error is raised instructing the user to add variables before loading the dataset.Coverage
kwarg intoorder_granules
(Commonly:region_a.order_granules(Coverage=region_a.order_vars.wanted)
) Required variables will get appended toCoverage
in thesubsetparams
method ofQuery
.Open questions (Now resolved)
UnboundLocalError: local variable 'groups_list' referenced before assignment
). Now the code loads a dataset object that is basically empty. Do we want this? --> We will raise a new descriptive error if the user has not added any variables before reading