Skip to content

Commit 2154476

Browse files
authored
Merge pull request #196 from cmu-delphi/patch-asof-dates
Add back change in as-of dates to match Sunday pipeline run
2 parents 3a98767 + ff94351 commit 2154476

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

dashboard/app.R

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -321,16 +321,15 @@ server <- function(input, output, session) {
321321

322322
# Get most recent target end date
323323
# Prev Saturday for Cases and Deaths, prev Wednesday for Hospitalizations
324-
# Since we don't upload new observed data until Monday:
325-
# Use 8 and 2 for Cases and Deaths so that Sundays will not use the Saturday directly beforehand
326-
# since we don't have data for it yet.
327-
# Use 5 and 11 for Hospitalizations since Thurs-Sun should also not use the Wednesday directly beforehand.
328-
# (This means that on Mondays until the afternoon when pipeline completes, the "as of" will show
329-
# most recent Saturday / Wednesday date even though the actual updated data won't be there yet)
330-
prevWeek <- seq(Sys.Date()-8,Sys.Date()-2,by='day')
324+
# Since we don't upload new observed data until Sunday:
325+
# Use 7 and 1 for Cases and Deaths so that Sundays will use the Saturday directly beforehand.
326+
# Use 4 and 10 for Hospitalizations since Thurs-Sat should not use the Wednesday directly beforehand.
327+
# (This means that on Sundays until the afternoon when the pipeline completes, the "as of" will show
328+
# the most recent Saturday / Wednesday date even though the actual updated data won't be there yet)
329+
prevWeek <- seq(Sys.Date()-7,Sys.Date()-1,by='day')
331330
CASES_DEATHS_CURRENT = prevWeek[weekdays(prevWeek)=='Saturday']
332331
CURRENT_WEEK_END_DATE = reactiveVal(CASES_DEATHS_CURRENT)
333-
prevHospWeek <- seq(Sys.Date()-11,Sys.Date()-5,by='day')
332+
prevHospWeek <- seq(Sys.Date()-10,Sys.Date()-4,by='day')
334333
HOSP_CURRENT = prevHospWeek[weekdays(prevHospWeek)=='Wednesday']
335334

336335
# Get scores

0 commit comments

Comments
 (0)