-
Notifications
You must be signed in to change notification settings - Fork 10
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
Prospective refactor #77
base: main
Are you sure you want to change the base?
Conversation
…order to match func signature
…um_initial_cases and prop_asym
…ument default in scenario_sim, outbreak_model and outbreak_step
… set argument default in scenario_sim, outbreak_model and outbreak_step
…eplace hardcoded incubation period with incubation_period arg
…incubation_period args
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.
Thanks @joshwlambert I this these are sensible suggestions - left some minor comments on style/linting.
#' @param outbreak_df_week data.table weekly cases produced by the outbreak | ||
#' model |
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.
#' @param outbreak_df_week data.table weekly cases produced by the outbreak | |
#' model | |
#' @param outbreak_df_week data.table weekly cases produced by the outbreak | |
#' model |
Should have 2 indents throughout here for readability as in e.g. https://github.com/r-lib/roxygen2/blob/9652d15221109917d46768e836eaf55e33c21633/R/roxygenize.R#L14
#' disp_com = 0.16, | ||
#' disp_subclin = 0.16, | ||
#' k = 0, | ||
#' onset_to_isolation = function(x) rweibull(n = x, shape = 1.651524, scale = 4.287786), |
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.
#' onset_to_isolation = function(x) rweibull(n = x, shape = 1.651524, scale = 4.287786), | |
#' onset_to_isolation = \(x) rweibull(n = x, shape = 1.651524, scale = 4.287786), |
we already have this notation elsewhere
outbreak_model <- function(num_initial_cases, | ||
prop_ascertain, | ||
cap_max_days, | ||
cap_cases, | ||
r0isolated, | ||
r0community, | ||
r0subclin = r0community, | ||
disp_iso, | ||
disp_com, | ||
disp_subclin = disp_com, | ||
k, | ||
onset_to_isolation, | ||
incubation_period, | ||
prop_asym, | ||
quarantine) { |
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.
outbreak_model <- function(num_initial_cases, | |
prop_ascertain, | |
cap_max_days, | |
cap_cases, | |
r0isolated, | |
r0community, | |
r0subclin = r0community, | |
disp_iso, | |
disp_com, | |
disp_subclin = disp_com, | |
k, | |
onset_to_isolation, | |
incubation_period, | |
prop_asym, | |
quarantine) { | |
outbreak_model <- function( | |
num_initial_cases, | |
prop_ascertain, | |
cap_max_days, | |
cap_cases, | |
r0isolated, | |
r0community, | |
r0subclin = r0community, | |
disp_iso, | |
disp_com, | |
disp_subclin = disp_com, | |
k, | |
onset_to_isolation, | |
incubation_period, | |
prop_asym, | |
quarantine | |
) { |
to be consistent with the style in other parts of the package
Thanks for the suggestions @sbfnk. Are you happy for me to work through the {ringbp} issues and make some of the changes included in this PR along the way? |
Yes, that would be great! |
This pull request makes a series of changes to the {ringbp} to hopefully improve the package.
This PR is not for merging. It is purely to demonstrate the types of changes that could be made in {ringbp}.
If this PR contains changes that we want to include in {ringbp} then I can make specific feature branches and tag the relevant issues. In this PR I have not related the changes to any existing issues in the {ringbp} GitHub repository as this was a more general exploration of how the package can be improved.
This is not a full refactor, but a start of to give a flavour of the improvements, without sinking too much time if we decide this is not the best direction of development for the package. Some changes include:
dist_spec()
function