-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
deprecate get functions for delay distributions
- Loading branch information
Showing
8 changed files
with
75 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,7 @@ | ||
test_that("get_dist returns distributional definition data in the format expected by EpiNow2", { | ||
test_that("get_dist is deprecated", { | ||
data <- data.table::data.table(mean = 1, mean_sd = 1, sd = 1, sd_sd = 1, source = "test", disease = "test", dist = "gamma") | ||
dist <- get_dist(data, disease = "test", source = "test") | ||
expect_equal( | ||
dist[c("mean_mean", "mean_sd", "sd_mean", "sd_sd", "max")], | ||
list(mean_mean = array(1), mean_sd = array(1), | ||
sd_mean = array(1), sd_sd = array(1), max = array(15L)) | ||
) | ||
}) | ||
|
||
test_that("get_dist returns distributional definition data in the format expected by EpiNow2 with no uncertainty", { | ||
data <- data.table::data.table(mean = 1, mean_sd = 1, sd = 1, sd_sd = 1, source = "test", disease = "test", dist = "lognormal") | ||
dist <- get_dist(data, disease = "test", source = "test", fixed = TRUE) | ||
expect_equal( | ||
round(dist$np_pmf[1:7], digits = 2), | ||
array(c(0.17, 0.23, 0.17, 0.12, 0.08, 0.06, 0.04)) | ||
expect_warning( | ||
get_dist(data, disease = "test", source = "test"), | ||
"deprecated" | ||
) | ||
}) |