Skip to content
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

Filter date bounds inclusive #708

Merged
merged 2 commits into from
Apr 2, 2021
Merged

Conversation

benjaminotter
Copy link
Contributor

Description of proposed changes

Changes filter to include the specified dates when filtering with --min-date and --max-date flags. With this change the max date filter now includes records up to and including the latest date, and likewise the min date filter also includes the lower bound.
Records with ambiguous dates such as 2020-03-XX or 2020-XX-01 are included if max date or min date lies in the same month (e.g. 2020-03-26) or year (e.g. 2020-01-23) respectively.

Related issue(s)

Fixes #683

Testing

Doctests are added for the expected behaviour.

@benjaminotter benjaminotter requested a review from huddlej March 31, 2021 17:06
@codecov
Copy link

codecov bot commented Mar 31, 2021

Codecov Report

Merging #708 (8d7e2df) into master (5c12fd8) will increase coverage by 0.33%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #708      +/-   ##
==========================================
+ Coverage   30.89%   31.23%   +0.33%     
==========================================
  Files          41       41              
  Lines        5648     5715      +67     
  Branches     1365     1392      +27     
==========================================
+ Hits         1745     1785      +40     
- Misses       3828     3855      +27     
  Partials       75       75              
Impacted Files Coverage Δ
augur/filter.py 49.24% <100.00%> (+3.26%) ⬆️
augur/distance.py 33.16% <0.00%> (-4.15%) ⬇️
augur/utils.py 40.78% <0.00%> (+3.02%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5c12fd8...8d7e2df. Read the comment docs.

Copy link
Contributor

@huddlej huddlej left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice. Thank you, @benjaminotter!

@huddlej huddlej marked this pull request as ready for review April 2, 2021 21:07
@huddlej huddlej merged commit 24baeaf into master Apr 2, 2021
@huddlej huddlej deleted the filter-date-bounds-inclusive branch April 2, 2021 21:07
@huddlej huddlej added this to the Next release milestone Apr 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

filter: make date-based bounds inclusive instead of exclusive
2 participants