Skip to content

Commit e996175

Browse files
committed
fix: slight date problem
1 parent 4c09e99 commit e996175

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

R/targets_utils.R

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,10 @@ make_shared_grids <- function() {
171171
}
172172

173173
#' Make forecasts and scores by ahead targets
174+
#' @description
175+
#' globals this depends on:
176+
#' Relies on the following globals:
177+
#' - `date_step`
174178
#' @export
175179
make_forecasts_and_scores_by_ahead <- function() {
176180
tar_map(
@@ -188,7 +192,7 @@ make_forecasts_and_scores_by_ahead <- function() {
188192
n_training_pad = 30L,
189193
forecaster_args = params,
190194
forecaster_args_names = param_names,
191-
date_range_step_size = 7L
195+
date_range_step_size = date_step
192196
)
193197
)
194198
),

covid_hosp_explore.R

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ fetch_args <- epidatr::fetch_args_list(return_empty = TRUE, timeout_seconds = 20
5959
data_targets <- make_data_targets()
6060

6161

62+
# These globals are needed by the function below (and they need to persist
63+
# during the actual targets run, since the commands are frozen as expressions).
64+
date_step <- 1L
6265
forecasts_and_scores_by_ahead <- make_forecasts_and_scores_by_ahead()
6366
forecasts_and_scores <- make_forecasts_and_scores()
6467
ensemble_targets <- make_ensemble_targets()

flu_hosp_explore.R

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ fetch_args <- epidatr::fetch_args_list(return_empty = TRUE, timeout_seconds = 30
4444
data_targets <- make_data_targets()
4545

4646

47+
# These globals are needed by the function below (and they need to persist
48+
# during the actual targets run, since the commands are frozen as expressions).
49+
date_step <- 7L
4750
forecasts_and_scores_by_ahead <- make_forecasts_and_scores_by_ahead()
4851
forecasts_and_scores <- make_forecasts_and_scores()
4952
ensemble_targets <- make_ensemble_targets()

0 commit comments

Comments
 (0)