@@ -151,7 +151,9 @@ rlang::list2(
151151 if (file.exists(here :: here(" .nhsn_flu_cache.parquet" ))) {
152152 previous_result <- qs :: qread(here :: here(" .nhsn_flu_cache.parquet" ))
153153 # if something is different, update the file
154- if (isFALSE(all.equal(previous_result , most_recent_result ))) {
154+ # !isTRUE(all.equal) is true iff there's at least one difference
155+ # can't use isFALSE(all.equal) because a bunch of strings are not, in fact, false
156+ if (! isTRUE(all.equal(previous_result , most_recent_result ))) {
155157 qs :: qsave(most_recent_result , here :: here(" .nhsn_flu_cache.parquet" ))
156158 }
157159 } else {
@@ -161,18 +163,14 @@ rlang::list2(
161163 },
162164 description = " Download the result, and update the file only if it's actually different" ,
163165 priority = 1 ,
166+ cue = tar_cue(mode = " always" )
164167 ),
165- tar_target (
166- nhsn_latest_data ,
168+ tar_change (
169+ name = nhsn_latest_data ,
167170 command = {
168171 qs :: qread(here :: here(" .nhsn_flu_cache.parquet" ))
169- }
170- ),
171- tar_target(
172- name = nhsn_archive_data ,
173- command = {
174- create_nhsn_data_archive(disease = " nhsn_flu" )
175- }
172+ },
173+ change = tools :: md5sum(here :: here(" .nhsn_flu_cache.parquet" ))
176174 ),
177175 tar_map(
178176 # Because targets relies on R metaprogramming, it loses the Date class.
@@ -269,7 +267,7 @@ rlang::list2(
269267 cue = tar_cue(mode = " always" )
270268 ),
271269 tar_target(
272- name = ensemble_res ,
270+ name = climate_linear ,
273271 command = {
274272 forecast_res %> %
275273 # Apply the ahead-by-quantile weighting scheme
@@ -284,7 +282,7 @@ rlang::list2(
284282 }
285283 ),
286284 tar_target(
287- name = ensemble_mixture_res ,
285+ name = ens_climate_linear_window_season ,
288286 command = {
289287 forecast_res %> %
290288 # Apply the ahead-by-quantile weighting scheme
@@ -299,7 +297,7 @@ rlang::list2(
299297 },
300298 ),
301299 tar_target(
302- name = ensemble_mixture_res_2 ,
300+ name = ens_climate_linear_window_season_ave_data ,
303301 command = {
304302 forecast_res_modified %> %
305303 # Apply the ahead-by-quantile weighting scheme
@@ -314,10 +312,10 @@ rlang::list2(
314312 }
315313 ),
316314 tar_target(
317- name = combo_ensemble_mixture_res ,
315+ name = combo_ens_climate_linear_window_season ,
318316 command = {
319317 inner_join(
320- ensemble_mixture_res , ensemble_mixture_res_2 ,
318+ ens_climate_linear_window_season , ens_climate_linear_window_season_ave_data ,
321319 by = join_by(geo_value , forecast_date , target_end_date , quantile )
322320 ) %> %
323321 rowwise() %> %
@@ -333,17 +331,17 @@ rlang::list2(
333331 command = {
334332 bind_rows(
335333 forecast_res ,
336- ensemble_res %> % mutate(forecaster = " ensemble" ),
337- ensemble_mixture_res %> % mutate(forecaster = " ensemble_mix " ),
338- ensemble_mixture_res_2 %> % mutate(forecaster = " ensemble_mix_2 " ),
339- combo_ensemble_mixture_res %> % mutate(forecaster = " combo_ensemble_mix " )
334+ climate_linear %> % mutate(forecaster = " ensemble" ),
335+ ens_climate_linear_window_season %> % mutate(forecaster = " ensemble_linclim_windowed_seasonal " ),
336+ ens_climate_linear_window_season_ave_data %> % mutate(forecaster = " ensemble_ave_data " ),
337+ combo_ens_climate_linear_window_season %> % mutate(forecaster = " ensemble_overall " )
340338 )
341339 }
342340 ),
343341 tar_target(
344342 name = make_submission_csv ,
345343 command = {
346- ensemble_res %> %
344+ combo_ens_climate_linear_window_season %> %
347345 format_flusight(disease = " flu" ) %> %
348346 write_submission_file(
349347 get_forecast_reference_date(forecast_date_int ),
@@ -463,6 +461,7 @@ rlang::list2(
463461 )
464462 )
465463 },
464+ cue = tar_cue(mode = " always" )
466465 )
467466 ),
468467 tar_target(
0 commit comments