Skip to content

Commit

Permalink
Remove tests stub and add silent = 2
Browse files Browse the repository at this point in the history
  • Loading branch information
athowes committed Aug 7, 2024
1 parent 9202c20 commit e0e0a63
Showing 1 changed file with 4 additions and 13 deletions.
17 changes: 4 additions & 13 deletions tests/testthat/test-unit-postprocess.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ test_that("predict_delay_parameters works with NULL newdata and the latent logno
skip_on_cran()
set.seed(1)
prep_obs <- as_latent_individual(sim_obs)
fit <- epidist(data = prep_obs, seed = 1)
fit <- epidist(data = prep_obs, seed = 1, silent = 2)
pred <- predict_delay_parameters(fit)
expect_s3_class(pred, "data.table")
expect_named(pred, c("draw", "index", "mu", "sigma", "mean", "sd"))
Expand All @@ -12,24 +12,15 @@ test_that("predict_delay_parameters works with NULL newdata and the latent logno
expect_equal(length(unique(pred$draw)), summary(fit)$total_ndraws)
})

test_that("predict_delay_parameters accepts newdata arguments", { # nolint: line_length_linter.
skip_on_cran()
set.seed(1)
prep_obs <- as_latent_individual(sim_obs)
fit <- epidist(data = prep_obs, seed = 1)
n <- 5
pred <- predict_delay_parameters(fit, newdata = prep_obs[1:n, ])

})

test_that("predict_delay_parameters accepts newdata arguments, all_strata_newdata works as expected, and predictions by sex recover underlying parameters", { # nolint: line_length_linter.
skip_on_cran()
set.seed(1)
prep_obs_sex <- as_latent_individual(sim_obs_sex)
fit_sex <- epidist(
data = prep_obs_sex,
formula = brms::bf(mu ~ 1 + sex, sigma ~ 1 + sex),
seed = 1
seed = 1,
silent = 2
)

all_strata <- all_strata_newdata(fit_sex)
Expand Down Expand Up @@ -61,7 +52,7 @@ test_that("predict_delay_parameters accepts newdata arguments, all_strata_newdat
c(meanlog_m, sdlog_m),
tolerance = 0.05
)

# Correction predictions of F
expect_equal(
as.numeric(pred_sex_summary[2, c("mu", "sigma")]),
Expand Down

0 comments on commit e0e0a63

Please sign in to comment.