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

Add filter_leading_zeros and zero_threshold to estimate_secondary() and estimate_truncation() #608

Merged
merged 25 commits into from
Mar 27, 2024

Conversation

jamesmbaazam
Copy link
Contributor

Description

This PR closes #605.

Initial submission checklist

  • My PR is based on a package issue and I have explicitly linked it.
  • I have tested my changes locally (using devtools::test() and devtools::check()).
  • I have added or updated unit tests where necessary.
  • I have updated the documentation if required and rebuilt docs if yes (using devtools::document()).
  • I have followed the established coding standards (and checked using lintr::lint_package()).
  • I have added a news item linked to this PR.

After the initial Pull Request

  • I have reviewed Checks for this PR and addressed any issues as far as I am able.

@seabbs seabbs requested review from seabbs and removed request for seabbs March 11, 2024 22:35
@jamesmbaazam jamesmbaazam force-pushed the add-filter-leading_zeros-arg branch from f6b1e15 to c44c17d Compare March 12, 2024 09:16
@jamesmbaazam jamesmbaazam requested review from sbfnk and seabbs March 12, 2024 12:45
NEWS.md Outdated Show resolved Hide resolved
R/estimate_secondary.R Show resolved Hide resolved
R/estimate_truncation.R Show resolved Hide resolved
tests/testthat/test-estimate_truncation.R Outdated Show resolved Hide resolved
R/estimate_truncation.R Outdated Show resolved Hide resolved
tests/testthat/test-estimate_secondary.R Outdated Show resolved Hide resolved
tests/testthat/test-estimate_truncation.R Outdated Show resolved Hide resolved
R/estimate_truncation.R Outdated Show resolved Hide resolved
R/estimate_truncation.R Outdated Show resolved Hide resolved
Copy link
Contributor

@sbfnk sbfnk left a comment

Choose a reason for hiding this comment

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

Some tests are failing - I left a couple of suggestions that I think will fix them.

R/estimate_secondary.R Outdated Show resolved Hide resolved
tests/testthat/test-estimate_secondary.R Outdated Show resolved Hide resolved
@jamesmbaazam jamesmbaazam force-pushed the add-filter-leading_zeros-arg branch from 307fc8e to f3d92fc Compare March 25, 2024 16:55
sbfnk
sbfnk previously approved these changes Mar 25, 2024
@sbfnk sbfnk self-requested a review March 25, 2024 19:59
@sbfnk
Copy link
Contributor

sbfnk commented Mar 27, 2024

This looks good now. I can make the minor changes needed to fix the tests and then, once you @jamesmbaazam approve, we can merge.

@sbfnk sbfnk enabled auto-merge (squash) March 27, 2024 08:09
@sbfnk
Copy link
Contributor

sbfnk commented Mar 27, 2024

I can't approve because I'm the last pusher.
@jamesmbaazam can't approve because is the PR author
@seabbs we might need your help here (or be bad and bypass branch protection roles)

@sbfnk sbfnk merged commit 0743eeb into main Mar 27, 2024
11 checks passed
@sbfnk sbfnk deleted the add-filter-leading_zeros-arg branch March 27, 2024 12:17
sbfnk added a commit that referenced this pull request May 3, 2024
…y()` and `estimate_truncation()` (#608)

* Add filter_leading_zeros and zero_threshold to estimate_secondary()

* Add filter_leading_zeros and zero_threshold to estimate_truncation()

* Call create_clean_reported_cases() in estimate_truncation()

* Remove breakpoint column created by create_clean_reported_cases()

* Add tests for the new arguments

* Fix wrong object name

* Remove unnecessary anonymous function to map

* Introduce an add_breakpoints argument to control adding a breakpoint column

* Set add_breakpoint to FALSE to not create a breakpoint column

* Document add_breakpoint argument

* Merge reports with secondary_reports after filtering leading zeroes

* Fix nested ifelse statement

* Remove trailing whitespace

* Update tests/testthat/test-estimate_secondary.R

Co-authored-by: Sebastian Funk <[email protected]>

* Replace anonymous function shorthand

* Add PR and reviewer

Co-authored-by: Sebastian Funk <[email protected]>

* Only replace NA with 0 if breakpoint column is present

* Only merge by date on secondary_reports

Co-authored-by: Sebastian Funk <[email protected]>

* Fix test

Co-authored-by: Sebastian Funk <[email protected]>

* Make sure all the datasets have the same start date

* Improve test to compare aspects of fits to original dataset

* move filtering up

* bring back copying (don't modify input object)

* use rstan in tests

---------

Co-authored-by: Sebastian Funk <[email protected]>
sbfnk added a commit that referenced this pull request May 3, 2024
…y()` and `estimate_truncation()` (#608)

* Add filter_leading_zeros and zero_threshold to estimate_secondary()

* Add filter_leading_zeros and zero_threshold to estimate_truncation()

* Call create_clean_reported_cases() in estimate_truncation()

* Remove breakpoint column created by create_clean_reported_cases()

* Add tests for the new arguments

* Fix wrong object name

* Remove unnecessary anonymous function to map

* Introduce an add_breakpoints argument to control adding a breakpoint column

* Set add_breakpoint to FALSE to not create a breakpoint column

* Document add_breakpoint argument

* Merge reports with secondary_reports after filtering leading zeroes

* Fix nested ifelse statement

* Remove trailing whitespace

* Update tests/testthat/test-estimate_secondary.R

Co-authored-by: Sebastian Funk <[email protected]>

* Replace anonymous function shorthand

* Add PR and reviewer

Co-authored-by: Sebastian Funk <[email protected]>

* Only replace NA with 0 if breakpoint column is present

* Only merge by date on secondary_reports

Co-authored-by: Sebastian Funk <[email protected]>

* Fix test

Co-authored-by: Sebastian Funk <[email protected]>

* Make sure all the datasets have the same start date

* Improve test to compare aspects of fits to original dataset

* move filtering up

* bring back copying (don't modify input object)

* use rstan in tests

---------

Co-authored-by: Sebastian Funk <[email protected]>
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.

Add filter_leading_zeros and zero_threshold arguments to estimate_secondary() and estimate_truncation()
3 participants