-
Notifications
You must be signed in to change notification settings - Fork 67
Code improvements to time processing routines #1010
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
Merged
Merged
Changes from 15 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
413928f
Type alias; rename methods; remove unused
rzats c8b008f
Fix tests
rzats 78f2bce
typing-extensions
rzats 5bb07f3
parse_day_or_week_range
rzats 877f6a0
use time value alias
rzats 3fe1eec
another TimePair
rzats 5d5b198
week/day
rzats 0c41283
fix
rzats 0807542
fix
rzats 0283b47
Fix typings
rzats 48350ca
no string tuples
rzats 5ddf1c0
validate
rzats 1b6643d
filter pt1
rzats 339efc8
filter pt2
rzats 59ebede
dmitry review
rzats 2a0d51a
final tweaks
rzats 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 hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,3 +11,4 @@ scipy==1.6.2 | |
tenacity==7.0.0 | ||
newrelic | ||
epiweeks==2.1.2 | ||
typing-extensions |
This file contains hidden or 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 hidden or 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 hidden or 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.
Question: is this a good code path to have? AFAICT there's an exception raised in
covidcast.py:parse_time_pairs
if you don't have either: a)time=...
or b)time_type=...
andtime_values=...
. So this will technically never happen in the API. So:not super blocking, i can go either way, but curious what everyone thinks here, cc @melange396 @krivard
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.
Like you've mentioned, I'd rather have the extra failsafe for function safety so I kept this for now (but it should be trivial to remove if needed)
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.
im not actually sure what would be most correct here... it could arguably even be reasonable to return
"TRUE"
-- if we are not filtering on any time, then all time values are valid.since it is ambiguous, i think its good to leave that condition there but but also add a comment to the effect of "time values are required by the API, so this case should never be reached, but this check further ensures the desired behavior"