Skip to content

Fixed rep phi #560

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

Merged
merged 6 commits into from
Feb 20, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
update tests
  • Loading branch information
sbfnk authored and seabbs committed Feb 20, 2024
commit ad80dfe9716a9be666c255d40715ae5570408d91
18 changes: 16 additions & 2 deletions tests/testthat/test-create_obs_model.R
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,23 @@ test_that("create_obs_model can be used with a custom week length", {
})

test_that("create_obs_model can be used with a user set phi", {
obs <- create_obs_model(dates = dates, obs = obs_opts(phi = c(10, 0.1)))
obs <- create_obs_model(
dates = dates, obs = obs_opts(phi = list(mean = 10, sd = 0.1))
)
expect_equal(obs$phi_mean, 10)
expect_equal(obs$phi_sd, 0.1)
expect_error(obs_opts(phi = c(10)))
obs <- create_obs_model(
dates = dates,
obs = obs_opts(phi = 0.5)
)
expect_equal(obs$phi_mean, 0.5)
expect_equal(obs$phi_sd, 0)
expect_error(obs_opts(phi = c("Hi", "World")))
})

test_that("using a vector for phi in create_obs_model is deprecated", {
expect_warning(
create_obs_model(dates = dates, obs = obs_opts(phi = c(10, 0.1))),
"deprecated"
)
})