-
Notifications
You must be signed in to change notification settings - Fork 19
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
Update NWM Client New interfaces and bring up to feature parity with old client [Updated] #227
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
9 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.
This turned out to be a bit bigger than I had intended, but it is the result of months of experimentation as well as feedback from frequent users of National Water Model output. I'll summarize changes for each component.
FileDownloader.py
Added an
overwrite
boolean parameter that will warn and skip similarly named files.NWMFileProcessor.py
Updated
get_dataset
to accept thexarray.open_mfdataset
paths
argument. Essential coordinates (reference_time
,time
, andfeature_id
) are always returned.NWMClient.py
Updated abstract interface to accept an
nwm_feature_ids
parameter to facilitate retrieval of smaller amounts of data. Unfortunately, retrieving data is still relatively slow, but this new interface accommodates the most common use-case (retrieval of time series data from a few sites).NWMFileClient.py
Added
unit_system
parameter to match oldernwm_client
unit handling. Replacedget_dataset
method withget_files
that just downloads files and returns their local paths.get
method works with severalconfigurations
andreference_times
by default. Implementsnwm_feature_ids
parameter.ParquetStore.py
Formerly
ParquetCache.py
, I decided to rename this module and reimplement as aMutableMapping
similar topandas.HDFStore
. It can still be used as a context manager, but now it also includes key-access and inherits useful methods likeget
andpop
fromMutableMapping
. As a consequence, the oldget
method was removed. This could live somewhere else, eventually.NWMClientDefaults.py
Added defaults for handling units, variables, and the new
ParquetStore
.UnitHandler.py
Taken verbatim from the older
nwm_client
. This could potentially live somewhere else (eventually)._version.py
bumped to 7.0.0 due to breaking interface changes
Checklist