@@ -12,7 +12,7 @@ truth_data_date <- "2023-09-01"
12
12
# today, which is a Wednesday. Sometimes, if we're doing a delayed forecast,
13
13
# it's a Thursday. It's used for stamping the data and for determining the
14
14
# appropriate as_of when creating the forecast.
15
- forecast_generation_dates <- Sys.Date() - 6
15
+ forecast_generation_dates <- Sys.Date()
16
16
# Usually, the forecast_date is the same as the generation date, but you can
17
17
# override this. It should be a Wednesday.
18
18
forecast_dates <- round_date(forecast_generation_dates , " weeks" , week_start = 3 )
@@ -263,23 +263,24 @@ ensemble_targets <- tar_map(
263
263
tar_target(
264
264
name = make_submission_csv ,
265
265
command = {
266
- if (! backtest_mode ) {
266
+ if (! backtest_mode && submission_directory != " cache " ) {
267
267
forecast_reference_date <- get_forecast_reference_date(forecast_date_int )
268
268
ensemble_mixture_res %> %
269
269
format_flusight(disease = " covid" ) %> %
270
270
write_submission_file(forecast_reference_date , file.path(submission_directory , " model-output/CMU-TimeSeries" ))
271
+ } else {
272
+ cli_alert_info(" Not making submission csv because we're in backtest mode or submission directory is cache" )
271
273
}
272
274
},
273
275
),
274
276
tar_target(
275
277
name = make_climate_submission_csv ,
276
278
command = {
277
- if (! backtest_mode ) {
278
- forecasts <- forecast_res
279
- forecasts %> %
279
+ if (! backtest_mode && submission_directory != " cache" ) {
280
+ forecast_full_filtered %> %
280
281
filter(forecaster %in% c(" climate_base" , " climate_geo_agged" )) %> %
281
282
group_by(geo_value , target_end_date , quantile ) %> %
282
- summarize(forecast_date = first( forecast_dates ), value = mean(value , na.rm = TRUE ), .groups = " drop" ) %> %
283
+ summarize(value = mean(value , na.rm = TRUE ), .groups = " drop" ) %> %
283
284
ungroup() %> %
284
285
format_flusight(disease = " covid" ) %> %
285
286
filter(location %nin % c(" 60" , " 66" , " 78" )) %> %
@@ -288,6 +289,8 @@ ensemble_targets <- tar_map(
288
289
submission_directory = file.path(submission_directory , " model-output/CMU-climate_baseline" ),
289
290
file_name = " CMU-climate_baseline"
290
291
)
292
+ } else {
293
+ cli_alert_info(" Not making climate submission csv because we're in backtest mode or submission directory is cache" )
291
294
}
292
295
},
293
296
),
0 commit comments