Skip to content

Commit 16dd527

Browse files
committed
fix tests (sd lag should only be 0)
1 parent d542be2 commit 16dd527

File tree

4 files changed

+6
-3
lines changed

4 files changed

+6
-3
lines changed

DESCRIPTION

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ Imports:
3030
slider,
3131
targets,
3232
tibble,
33-
tidyr
33+
tidyr,
34+
zeallot
3435
Suggests:
3536
ggplot2,
3637
knitr,

R/data_validation.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ perform_sanity_checks <- function(epi_data,
5656
#' @export
5757
confirm_sufficient_data <- function(epi_data, ahead, args_input, buffer = 9) {
5858
if (!is.null(args_input$lags)) {
59-
lag_max <- max(args_input$lags)
59+
lag_max <- max(unlist(args_input$lags))
6060
} else {
6161
lag_max <- 14 # default value of 2 weeks
6262
}

R/forecaster_smoothed_scaled.R

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
#' /target/ it still uses the raw value (this captures some of the noise). It
66
#' also uses a rolling standard deviation as an auxillary signal, window of
77
#' withd `sd_width`, which by default is 28 days.
8+
#' If you are using `sd_width`, you should restrict the lags on the `sd` to only
9+
#' include `0`, so set your lags to be e.g. `list(c(0,7,14), c(0))`.
810
#' @param epi_data the actual data used
911
#' @param outcome the name of the target variable
1012
#' @param extra_sources the name of any extra columns to use. This list could be

tests/testthat/test-forecasters-data.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ forecasters <- tibble::tribble(
77
scaled_pop, list(1, TRUE), list("ahead", "pop_scaling"), "scaled_pop",
88
scaled_pop, list(1, FALSE), list("ahead", "pop_scaling"), "scaled_pop",
99
flatline_fc, list(1), list("ahead"), "flatline_fc",
10-
smoothed_scaled, list(1), list("ahead"), "smoothed_scaled"
10+
smoothed_scaled, list(1, list(c(0,7,14), c(0))), list("ahead", "lags"), "smoothed_scaled"
1111
)
1212
expects_nonequal <- c("scaled_pop", "smoothed_scaled")
1313
synth_mean <- 25

0 commit comments

Comments
 (0)