-
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
Add cache_filename
parameter to the NWIS Client constructor
#176
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
…on is configurable
… slow down tests, but potentially resolve odd testing behavior in the future
10 tasks
cache_filename
parameter to the NWIS Client constructor
Nice! thank you @aaraney |
jarq6c
approved these changes
Feb 9, 2022
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.
Looks good!
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 PR adds
cache_filename
parameter to the NWIS Client. This allows a user to specify the location to store cached requests.closes #175.
Additions
cache_filename
parameter added tonwis_client.IVDataService. Allows a user to configure the name and location of the sqlite cache. Default remains
nwisiv_cache.sqlite.
cache_filename's that do not include the suffix
.sqlitewill have
.sqlite` concatenated as their file-type suffix.Changes
nwis_client
> 3.1 will raiseRuntimeError
exception instead ofRuntimeWarning
when arguments in**params
case insensitively match a non-**params
argument. (i.e.service.get(startdt="2022-01-01", ...)
the correct call isservice.get(startDT="2022-01-01", ...)
). Previously, the proposed warning to error timeline wasnwis_client
> 3.0.Testing
nwis_client
now use temporary cache file. This results in test speeds that are slower, but it mitigates potentially strange behavior that might result from unit tests sharing a cache.Notes
hydrotools._restclient.RestClient
instance to theIVDataService
constructor. it might be nice to have dependency injection when we are to expand to othernwis
REST services (i.e. daily value service).Checklist