Skip to content

Commit

Permalink
Don't allow null values
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesmbaazam committed Oct 30, 2023
1 parent e7160eb commit f798499
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
12 changes: 6 additions & 6 deletions R/estimate_infections.R
Original file line number Diff line number Diff line change
Expand Up @@ -135,14 +135,14 @@ estimate_infections <- function(reported_cases,
verbose = interactive()) {
# Validate inputs
check_reports_valid(reported_cases, model = "estimate_infections")
assert_class(generation_time, "generation_time_opts", null.ok = TRUE)
assert_class(delays, "delay_opts", null.ok = TRUE)
assert_class(truncation, "trunc_opts", null.ok = TRUE)
assert_class(generation_time, "generation_time_opts")
assert_class(delays, "delay_opts")
assert_class(truncation, "trunc_opts")
assert_class(rt, "rt_opts", null.ok = TRUE)
assert_class(backcalc, "backcalc_opts", null.ok = TRUE)
assert_class(backcalc, "backcalc_opts")
assert_class(gp, "gp_opts", null.ok = TRUE)
assert_class(obs, "obs_opts", null.ok = TRUE)
assert_class(stan, "stan_opts", null.ok = TRUE)
assert_class(obs, "obs_opts")
assert_class(stan, "stan_opts")
assert_numeric(horizon, lower = 0)
assert_numeric(CrIs, lower = 0, upper = 1)
assert_logical(filter_leading_zeros)
Expand Down
8 changes: 4 additions & 4 deletions R/estimate_secondary.R
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,10 @@ estimate_secondary <- function(reports,
...) {
# Validate the inputs
check_reports_valid(reports, model = "estimate_secondary")
assert_class(secondary, "secondary_opts", null.ok = TRUE)
assert_class(delays, "delay_opts", null.ok = TRUE)
assert_class(truncation, "trunc_opts", null.ok = TRUE)
assert_class(obs, "obs_opts", null.ok = TRUE)
assert_class(secondary, "secondary_opts")
assert_class(delays, "delay_opts")
assert_class(truncation, "trunc_opts")
assert_class(obs, "obs_opts")
assert_numeric(burn_in, lower = 0)
assert_numeric(CrIs, lower = 0, upper = 1)
assert_data_frame(priors, null.ok = TRUE)
Expand Down
4 changes: 2 additions & 2 deletions R/estimate_truncation.R
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,8 @@ estimate_truncation <- function(obs, max_truncation, trunc_max = 10,
...) {
# Validate inputs
walk(obs, check_reports_valid, model = "estimate_truncation")
assert_class(truncation, "dist_spec", null.ok = TRUE)
assert_class(model, "stanfit", null.ok = TRUE)
assert_class(truncation, "dist_spec")
assert_class(model, "stanfit")
assert_numeric(CrIs, lower = 0, upper = 1)
assert_logical(weigh_delay_priors)
assert_logical(verbose)
Expand Down

0 comments on commit f798499

Please sign in to comment.