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

Weight delays separately #630

Merged
merged 7 commits into from
Apr 22, 2024
Merged

Weight delays separately #630

merged 7 commits into from
Apr 22, 2024

Conversation

sbfnk
Copy link
Contributor

@sbfnk sbfnk commented Mar 28, 2024

Description

This PR closes #519.

It adds a weight_priors argument (having realise that "weigh" is the wrong verb!) to generation_time_opts(), delay_opts() and trunc_opts(). I'm not sure this is a super clear argument name but I haven't been able to come up with a better one.

The ..._opts() functions then add this to the delay distributions as an attribute. This necessitated some additional attribute copying in other parts of the code which is not great as it affects stability of the code but perhaps unavoidable.

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.

@sbfnk sbfnk requested a review from jamesmbaazam April 19, 2024 12:34
NEWS.md Outdated Show resolved Hide resolved
R/opts.R Outdated Show resolved Hide resolved
R/opts.R Outdated Show resolved Hide resolved
jamesmbaazam
jamesmbaazam previously approved these changes Apr 19, 2024
Copy link
Contributor

@jamesmbaazam jamesmbaazam left a comment

Choose a reason for hiding this comment

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

LGTM. I like that this option is now used at a more granular level, allowing for more control on the user side. I left a few suggestions in the documentation. Also, I think your choice of "weight" is correct and descriptive.

sbfnk and others added 2 commits April 22, 2024 15:10
Co-authored-by: James Azam <james.azam@lshtm.ac.uk>
@sbfnk sbfnk enabled auto-merge (squash) April 22, 2024 14:13
@sbfnk sbfnk disabled auto-merge April 22, 2024 18:44
@sbfnk sbfnk merged commit b70f7ad into main Apr 22, 2024
9 checks passed
@sbfnk sbfnk deleted the weigh-separately branch April 22, 2024 18:44
sbfnk added a commit that referenced this pull request May 3, 2024
* weight delays separately

* update snapshot (rounding?)

* add news item

* add PR number and reviewer

Co-authored-by: James Azam <james.azam@lshtm.ac.uk>

* rephrase documentation

---------

Co-authored-by: James Azam <james.azam@lshtm.ac.uk>
sbfnk added a commit that referenced this pull request May 3, 2024
* weight delays separately

* update snapshot (rounding?)

* add news item

* add PR number and reviewer

Co-authored-by: James Azam <james.azam@lshtm.ac.uk>

* rephrase documentation

---------

Co-authored-by: James Azam <james.azam@lshtm.ac.uk>
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.

weigh_delay_priors should be an option to generation_time_opts, delay_opts and truncation_opts
2 participants