@@ -212,7 +212,6 @@ rlang::list2(
212212 } else {
213213 train_data <- nhsn_latest_data
214214 }
215- nssp <- current_nssp_archive %> % epix_as_of(min(forecast_date , current_nssp_archive $ versions_end ))
216215 full_data <- train_data %> %
217216 bind_rows(joined_latest_extra_data )
218217 attributes(full_data )$ metadata $ other_keys <- " source"
@@ -223,6 +222,8 @@ rlang::list2(
223222 tar_target(
224223 forecast_res ,
225224 command = {
225+ forecast_date <- as.Date(forecast_date_int )
226+ nssp <- current_nssp_archive %> % epix_as_of(min(forecast_date , current_nssp_archive $ versions_end ))
226227 full_data %> %
227228 forecaster_fns [[forecasters ]](ahead = aheads , extra_data = nssp ) %> %
228229 mutate(
@@ -239,6 +240,8 @@ rlang::list2(
239240 command = {
240241 as_of <- attributes(full_data )$ metadata $ as_of
241242 other_keys <- attributes(full_data )$ metadata $ other_keys
243+ forecast_date <- as.Date(forecast_date_int )
244+ nssp <- current_nssp_archive %> % epix_as_of(min(forecast_date , current_nssp_archive $ versions_end ))
242245
243246 # Smooth last few points for every geo.
244247 # TODO: This is a hack, we can try some more sophisticated
@@ -256,7 +259,7 @@ rlang::list2(
256259 attributes(modified_full_data )$ metadata $ as_of <- as_of
257260 attributes(modified_full_data )$ metadata $ other_keys <- other_keys
258261 modified_full_data %> %
259- forecaster_fns [[forecasters ]](ahead = aheads ) %> %
262+ forecaster_fns [[forecasters ]](ahead = aheads , extra_data = nssp ) %> %
260263 mutate(
261264 forecaster = names(forecaster_fns [forecasters ]),
262265 geo_value = as.factor(geo_value )
0 commit comments