Skip to content

Commit

Permalink
hotfix from Dan
Browse files Browse the repository at this point in the history
  • Loading branch information
dsweber2 committed Jul 8, 2024
1 parent ec9a2e3 commit 3083fcc
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion R/layer_add_forecast_date.R
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ slather.layer_add_forecast_date <- function(object, components, workflow, new_da
)$time_type
if (expected_time_type == "week") expected_time_type <- "day"
validate_date(forecast_date, expected_time_type,
call = expr(layer_add_forecast_date())
call = rlang::expr(layer_add_forecast_date())
)
forecast_date <- coerce_time_type(forecast_date, expected_time_type)
object$forecast_date <- forecast_date
Expand Down
4 changes: 2 additions & 2 deletions R/layer_add_target_date.R
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ slather.layer_add_target_date <- function(object, components, workflow, new_data
if (!is.null(object$target_date)) {
target_date <- object$target_date
validate_date(target_date, expected_time_type,
call = expr(layer_add_target_date())
call = rlang::expr(layer_add_target_date())
)
target_date <- coerce_time_type(target_date, expected_time_type)
} else if (
Expand All @@ -122,7 +122,7 @@ slather.layer_add_target_date <- function(object, components, workflow, new_data
the_frosting, "layer_add_forecast_date", "forecast_date"
))) {
validate_date(forecast_date, expected_time_type,
call = expr(layer_add_forecast_date())
call = rlang::expr(layer_add_forecast_date())
)
forecast_date <- coerce_time_type(forecast_date, expected_time_type)
ahead <- extract_argument(the_recipe, "step_epi_ahead", "ahead")
Expand Down
4 changes: 2 additions & 2 deletions R/utils-latency.R
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,11 @@ get_latency <- function(new_data, forecast_date, column, sign_shift, epi_keys_ch
#' a potentially different max_time_value
#' @keywords internal
get_forecast_date_in_layer <- function(this_recipe, workflow_max_time_value, new_data) {
max_time_value <- max(
max_time_value <- as.Date(max(
workflow_max_time_value,
this_recipe$max_time_value,
max(new_data$time_value)
)
))
if (this_recipe %>% recipes::detect_step("adjust_latency")) {
# get the as_of in an `adjust_latency` step, regardless of where
handpicked_forecast_date <- map(
Expand Down

0 comments on commit 3083fcc

Please sign in to comment.