Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 3 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,6 @@
^.lintr$
^.venv$
^inst/templates$
^\.workflow$
^\.plans$
^\.claude$
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@ inst/doc
renv.lock
renv/
.Renviron
.workflow/
.plans/
.claude/
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: epipredict
Title: Basic epidemiology forecasting methods
Version: 0.2.2
Version: 0.2.3
Authors@R: c(
person("Daniel J.", "McDonald", , "daniel@stat.ubc.ca", role = c("aut", "cre")),
person("Ryan", "Tibshirani", , "ryantibs@cmu.edu", role = "aut"),
Expand Down
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

Pre-1.0.0 numbering scheme: 0.x will indicate releases, while 0.0.x will indicate PR's.

# epipredict 0.2.3

- Fix `print.canned_epipred()` so the latency-adjustment information actually displays for canned forecasters that include `step_adjust_latency` in their recipe (#447).

# epipredict 0.2.2

- Fix `autoplot.epi_workflow()` to correctly handle the response variable and avoid errors related to `.response`.
Expand Down
2 changes: 1 addition & 1 deletion R/canned-epipred.R
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ print.canned_epipred <- function(x, name, ...) {
"At forecast date{?s}: {.val {fds}},",
"For target date{?s}: {.val {tds}},"
))
if ("pre" %in% names(x) && "actions" %in% names(x$pre) && "recipe" %in% names(x$pre$actions)) {
if (!is.null(x$epi_workflow$pre$actions$recipe)) {
fit_recipe <- extract_recipe(x$epi_workflow)
if (detect_step(fit_recipe, "adjust_latency")) {
is_adj_latency <- map_lgl(fit_recipe$steps, function(x) inherits(x, "step_adjust_latency"))
Expand Down
2 changes: 2 additions & 0 deletions tests/testthat/_snaps/snapshots.md
Original file line number Diff line number Diff line change
Expand Up @@ -727,6 +727,7 @@
* 56 unique geographic regions,
* At forecast date: 2022-01-03,
* For target date: 2022-01-10,
* Lags adjusted per column: case_rate=3, death_rate=3

---
Expand All @@ -750,6 +751,7 @@
* 56 unique geographic regions,
* At forecast date: 2022-01-03,
* For target date: 2022-01-10,
* Aheads adjusted for death_rate=3

# arx_classifier snapshots
Expand Down
8 changes: 8 additions & 0 deletions tests/testthat/test-snapshots.R
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,10 @@ test_that("arx_forecaster output format snapshots", {
expect_equal(as.Date(format(out2$metadata$forecast_created, "%Y-%m-%d")), Sys.Date())
out2$metadata$forecast_created <- as.Date("1999-01-01")
expect_snapshot(out2)
expect_match(
paste(testthat::capture_messages(print(out2)), collapse = ""),
"adjusted"
)
out3 <- arx_forecaster(jhu, "death_rate",
c("case_rate", "death_rate"),
trainer = quantile_reg(),
Expand All @@ -143,6 +147,10 @@ test_that("arx_forecaster output format snapshots", {
expect_equal(as.Date(format(out3$metadata$forecast_created, "%Y-%m-%d")), Sys.Date())
out3$metadata$forecast_created <- as.Date("1999-01-01")
expect_snapshot(out3)
expect_match(
paste(testthat::capture_messages(print(out3)), collapse = ""),
"adjusted"
)
})

test_that("arx_classifier snapshots", {
Expand Down