-
Notifications
You must be signed in to change notification settings - Fork 129
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
Support incomplete ambiguous dates #631
Conversation
Codecov Report
@@ Coverage Diff @@
## master #631 +/- ##
==========================================
+ Coverage 28.53% 28.68% +0.14%
==========================================
Files 39 39
Lines 5389 5389
Branches 1327 1326 -1
==========================================
+ Hits 1538 1546 +8
+ Misses 3793 3785 -8
Partials 58 58
Continue to review full report at Codecov.
|
Reverts logic in augur filter to not consider ambiguous date results and removes logic for tracking ambiguous dates from `get_numerical_dates`.
Updates the help documentation for the ambiguous date filter and uses the "not" operator instead of "is False" for readability of boolean expressions.
Expands the logic of the date ambiguity test function to support date strings like "YYYY" and "YYYY-MM" that caused the previous implementation to break. Since a date with only a year or year and month is stil valid, we mockup ambiguous day and month values for these incomplete date strings and explicitly test the resulting year, month, and day values. This commit also adds unit tests to represent these incomplete and ambiguous date strings.
9ee8661
to
3fd75d8
Compare
Cleans up unit tests for the `is_date_ambiguous` function, collecting them into a single function with clearer documentation. Also, adds tests for valid incomplete date strings and fixes a bug in the `is_date_ambiguous` function that was revealed by these new tests.
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.
Nice work @huddlej - another super useful addition to augur 👍
Replaces the "all" option for `is_date_ambiguous` with "any" and updates the help documentation, ambiguity boolean logic, and unit tests to clarify this hierarchical treatment of ambiguity.
Description of proposed changes
This PR continues work from #623 by adding support for incomplete ambiguous date strings like those matching the formats of "YYYY" and "YYYY-MM".
Related issue(s)
Related to #602.
Testing
Adds new unit tests for the case of incomplete ambiguous date strings.
Prior to merge
This PR should be rebased onto master after #623 is merged to avoid a messy git history.