-
Notifications
You must be signed in to change notification settings - Fork 34
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 check and warning for PMFs longer than the data #998
base: main
Are you sure you want to change the base?
Conversation
3a00243
to
2ef6f3d
Compare
delays <- list(...) | ||
flat_delays <- do.call(c, delays) | ||
# Track which component each delay came from | ||
delay_names <- rep(names(delays), vapply(delays, EpiNow2:::ndist, numeric(1))) |
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.
you dont need ::: for internal functions. This is throwing a valid linting issue
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.
Looks good. The vast majority of the linting issues being thrown are from the linting change vs this PR so don't need to be addressed here.
My main comment is do we just need to check individual lengths or do we also need to check the lengths of combined delays (i.e. the reporting delay when it is a reporting delay and a incubation period)?
|
||
# Check lengths and collect info about exceeding PMFs | ||
pmf_longer_than_data <- vapply(flat_delays[np_delays], function(x) { | ||
length(x$pmf) > nrow(data) |
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.
don't we need to also check if the total reporting delay is longer than the data or the case where two distributions are passed to the generation time (not sure this is something you can actually do?)
Description
This PR closes #739.
Initial submission checklist
devtools::test()
anddevtools::check()
).devtools::document()
).lintr::lint_package()
).After the initial Pull Request