Skip to content

Commit b3c96b3

Browse files
committed
various requests and rebasing on dev
1 parent e70d553 commit b3c96b3

File tree

4 files changed

+8
-39
lines changed

4 files changed

+8
-39
lines changed

R/arx_classifier.R

+4-4
Original file line numberDiff line numberDiff line change
@@ -190,10 +190,10 @@ arx_class_epi_workflow <- function(
190190
)
191191
}
192192
}
193+
# regex that will match any amount of adjustment for the ahead
193194
ahead_out_name <- glue::glue("ahead_[0-9]*_{pre_out_name}")
194195
method_adjust_latency <- args_list$adjust_latency
195196
if (method_adjust_latency != "none") {
196-
# only extend_ahead is supported atm
197197
r <- r %>% step_adjust_latency(!!pre_out_name,
198198
fixed_forecast_date = forecast_date,
199199
method = method_adjust_latency
@@ -328,9 +328,9 @@ arx_class_args_list <- function(
328328
if (!is.null(forecast_date) && !is.null(target_date)) {
329329
if (forecast_date + ahead != target_date) {
330330
cli_warn(
331-
c(
332-
"`forecast_date` + `ahead` must equal `target_date`.",
333-
i = "{.val {forecast_date}} + {.val {ahead}} != {.val {target_date}}."
331+
paste0(
332+
"`forecast_date` {.val {forecast_date}} +",
333+
" `ahead` {.val {ahead}} must equal `target_date` {.val {target_date}}."
334334
),
335335
class = "epipredict__arx_args__inconsistent_target_ahead_forecaste_date"
336336
)

R/arx_forecaster.R

+3-11
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ arx_forecaster <- function(
6161

6262

6363
preds <- forecast(wf, forecast_date = forecast_date) %>%
64-
tibble::as_tibble() %>%
64+
as_tibble() %>%
6565
select(-time_value)
6666

6767
structure(
@@ -140,11 +140,7 @@ arx_fcast_epi_workflow <- function(
140140
forecast_date <- args_list$forecast_date %||% forecast_date_default
141141
target_date <- args_list$target_date %||% (forecast_date + args_list$ahead)
142142
if (forecast_date + args_list$ahead != target_date) {
143-
cli_abort(
144-
c(
145-
"`forecast_date` + `ahead` must equal `target_date`.",
146-
i = "{.val {forecast_date}} + {.val {ahead}} != {.val {target_date}}."
147-
),
143+
cli_abort("`forecast_date` {.val {forecast_date}} + `ahead` {.val {ahead}} must equal `target_date` {.val {target_date}}.",
148144
class = "epipredict__arx_forecaster__inconsistent_target_ahead_forecaste_date"
149145
)
150146
}
@@ -314,11 +310,7 @@ arx_args_list <- function(
314310

315311
if (!is.null(forecast_date) && !is.null(target_date)) {
316312
if (forecast_date + ahead != target_date) {
317-
cli_abort(
318-
c(
319-
"`forecast_date` + `ahead` must equal `target_date`.",
320-
i = "{.val {forecast_date}} + {.val {ahead}} != {.val {target_date}}."
321-
),
313+
cli_abort("`forecast_date` {.val {forecast_date}} + `ahead` {.val {ahead}} must equal `target_date` {.val {target_date}}.",
322314
class = "epipredict__arx_args__inconsistent_target_ahead_forecaste_date"
323315
)
324316
}

R/epi_recipe.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ epi_recipe.epi_df <-
9494
## Check and add roles when available
9595
if (!is.null(roles)) {
9696
if (length(roles) != length(vars)) {
97-
cli_abort(paste(
97+
cli_abort(paste0(
9898
"The number of roles should be the same as the number of ",
9999
"variables."
100100
))

R/utils-enframer.R

-23
This file was deleted.

0 commit comments

Comments
 (0)