Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
ca3dddb
refactor: start applying new template
sgratzl Sep 15, 2021
df2e55b
refactor: continue splitting code
sgratzl Sep 15, 2021
f8e45fe
refactor: apply styler
sgratzl Sep 15, 2021
d7c60fb
refactor: ui
sgratzl Sep 15, 2021
ca2ce5d
build: download missing files
sgratzl Sep 15, 2021
8fad6d5
refactor: cleanup + data
sgratzl Sep 15, 2021
5524a4b
refactor: move functions
sgratzl Sep 16, 2021
1296b8b
ci: don't download useless file
sgratzl Sep 16, 2021
d6c9dc7
fix: accessing reactive variables
sgratzl Sep 17, 2021
6944895
fix: missing asOf error and simplify
sgratzl Sep 17, 2021
7b5462e
refactor: extract functions to simplify
sgratzl Sep 17, 2021
c218c2c
fix: format code
sgratzl Sep 17, 2021
49e0d46
fix: fix linting
sgratzl Sep 17, 2021
e5518ac
fix: add missing about dashboard text
sgratzl Sep 17, 2021
373cbd5
refactor: simplify layout header embed
sgratzl Sep 17, 2021
7d12910
refactor: simplify imports
sgratzl Sep 17, 2021
f66e811
refactor: inline library use
sgratzl Sep 17, 2021
17d5d0f
fix: wrong stringr method
sgratzl Sep 18, 2021
8674569
style: improve left panel style
sgratzl Sep 18, 2021
da0a376
ci: simplify workflow
sgratzl Sep 22, 2021
d6a744b
Merge remote-tracking branch 'origin/dev' into sgratzl/style_refactor
sgratzl Sep 22, 2021
e0446a3
build: fix package description
sgratzl Sep 22, 2021
81e9111
add sunday pipeline run
nmdefries Sep 23, 2021
f958375
set app timeout
nmdefries Sep 23, 2021
6c1c1cc
set user session timeout
nmdefries Sep 23, 2021
497ce48
Merge remote-tracking branch 'origin/dev' into sgratzl/style_refactor
sgratzl Sep 24, 2021
7f78b1d
Merge pull request #178 from cmu-delphi/increase-timeout-threshold
nmdefries Sep 24, 2021
0e4cc3b
Merge branch 'dev' into sgratzl/style_refactor
nmdefries Sep 24, 2021
f9840ed
Merge pull request #171 from cmu-delphi/sgratzl/style_refactor
nmdefries Sep 24, 2021
ce23a44
update as-of display dates to match
nmdefries Sep 24, 2021
a9c1565
Merge branch 'dev' into pipeline-run-sunday
nmdefries Sep 24, 2021
4b0d993
re-enable scaleByBaseline for hospitalizations
nmdefries Sep 24, 2021
ffc7bc4
ci: fix image generation by pulling data
sgratzl Sep 25, 2021
6a1b500
build: clean apt-get once done
sgratzl Sep 25, 2021
f41ee38
Merge pull request #181 from cmu-delphi/sgratzl/fix_image
nmdefries Sep 27, 2021
350a8db
Revert "set user session timeout"
nmdefries Sep 29, 2021
12547a8
decrease app timeout
nmdefries Sep 29, 2021
d4a3345
Merge pull request #183 from cmu-delphi/revert-app-session-timeout
nmdefries Sep 29, 2021
df6952a
match docker port mapping to shiny export port
nmdefries Sep 29, 2021
0bb55fc
Merge branch 'dev' into cleanup-v4.1
nmdefries Sep 29, 2021
6bffe63
Merge pull request #182 from cmu-delphi/cleanup-v4.1
nmdefries Sep 30, 2021
416330f
Merge pull request #184 from cmu-delphi/fix-docker-port-mapping
nmdefries Sep 30, 2021
c385109
fix: use remote google font
sgratzl Sep 30, 2021
583da6c
Merge pull request #180 from cmu-delphi/enable-hosp-scalebybaseline
nmdefries Sep 30, 2021
ee8e90f
Merge pull request #185 from cmu-delphi/sgratzl/remotegooglefont
nmdefries Sep 30, 2021
3da2a05
Merge pull request #177 from cmu-delphi/pipeline-run-sunday
nmdefries Sep 30, 2021
f09d4e1
Revert "Merge pull request #185 from cmu-delphi/sgratzl/remotegooglef…
nmdefries Sep 30, 2021
7747658
Revert "Merge pull request #184 from cmu-delphi/fix-docker-port-mapping"
nmdefries Sep 30, 2021
8b9f6e6
Revert "Merge pull request #181 from cmu-delphi/sgratzl/fix_image"
nmdefries Sep 30, 2021
56fc4a2
Revert "Merge pull request #171 from cmu-delphi/sgratzl/style_refactor"
nmdefries Sep 30, 2021
4cd31c2
Merge pull request #193 from cmu-delphi/revert-template-refactor+
nmdefries Sep 30, 2021
51794d1
display scalebybaseline box for hosp
nmdefries Sep 30, 2021
1134c92
add memoise dependency
nmdefries Sep 30, 2021
3a98767
Merge pull request #194 from cmu-delphi/display-scalebybaseline-choic…
nmdefries Oct 1, 2021
ff94351
add back change in asof dates to match sunday pipeline run
nmdefries Oct 1, 2021
430ee5c
cache covidcast pulls
nmdefries Sep 30, 2021
2154476
Merge pull request #196 from cmu-delphi/patch-asof-dates
nmdefries Oct 1, 2021
23925d2
Merge pull request #197 from cmu-delphi/cache-covidcast-pulls
nmdefries Oct 1, 2021
ef03c26
Version 4.2.0 updates
nmdefries Oct 4, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/s3_upload_ec2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ env:
# Controls when the action will run.
on:
schedule:
- cron: '0 14 * * MON-TUE' # every Monday and Tuesday at 9amET
- cron: '0 14 * * SUN,MON,TUE' # every Monday and Tuesday at 10amET

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
Expand Down
11 changes: 4 additions & 7 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
Package: forecast-eval
Title: Forecast Evaluation Dashboard
Version: 4.1
Authors@R: person("Kate", "Harwood",
role = c("cre")),
person("Chris", "Scott",
role = c("cre")),
person("Jed", "Grabman",
role = c("cre"))
Version: 4.2.0
Authors@R: c(person("Kate", "Harwood", email = "[email protected]", role = "cre"),
person("Chris", "Scott", role = "ctb"),
person("Jed", "Grabman", role = "ctb"))
Description: This app collects and scores COVID-19 forecasts submitted to the CDC and displays the results in an RShiny dashboard.
License: MIT License, Copyright (c) 2021 Delphi contributors
34 changes: 23 additions & 11 deletions dashboard/app.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,22 @@ library(tsibble)
library(aws.s3)
library(covidcast)
library(stringr)
library(memoise)

source('./common.R')

# Set application-level caching location. Stores up to 1GB of caches. Removes
# least recently used objects first.
shinyOptions(cache = cachem::cache_mem(max_size = 1000 * 1024^2, evict="lru"))
cache <- getShinyOption("cache")

# Since covidcast data updates about once a day. Add date arg to
# covidcast_signal so caches aren't used after that.
covidcast_signal_mem <- function(..., date=Sys.Date()) {
return(covidcast_signal(...))
}
covidcast_signal_mem <- memoise(covidcast_signal_mem, cache = cache)

# All data is fully loaded from AWS
DATA_LOADED = FALSE

Expand Down Expand Up @@ -88,7 +101,7 @@ ui <- fluidPage(padding=0, title="Forecast Eval Dashboard",
"Log Scale",
value = FALSE,
)),
conditionalPanel(condition = "input.scoreType != 'coverage' && input.targetVariable != 'Hospitalizations'",
conditionalPanel(condition = "input.scoreType != 'coverage'",
checkboxInput(
"scaleByBaseline",
"Scale by Baseline Forecaster",
Expand Down Expand Up @@ -321,16 +334,15 @@ server <- function(input, output, session) {

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

# Get scores
Expand Down Expand Up @@ -469,7 +481,7 @@ server <- function(input, output, session) {
filteredScoreDf = filteredScoreDf[c("Forecaster", "Forecast_Date", "Week_End_Date", "Score", "ahead")]
filteredScoreDf = filteredScoreDf %>% mutate(across(where(is.numeric), ~ round(., 2)))
if (input$scoreType != 'coverage') {
if (input$scaleByBaseline && input$targetVariable != "Hospitalizations") {
if (input$scaleByBaseline) {
baselineDf = filteredScoreDf %>% filter(Forecaster %in% 'COVIDhub-baseline')
filteredScoreDfMerged = merge(filteredScoreDf, baselineDf, by=c("Week_End_Date","ahead"))
# Scaling score by baseline forecaster
Expand Down Expand Up @@ -915,7 +927,7 @@ server <- function(input, output, session) {
fetchDate = as.Date(input$asOf) + 1

# Covidcast API call
asOfTruthData = covidcast_signal(data_source = dataSource, signal = targetSignal,
asOfTruthData = covidcast_signal_mem(data_source = dataSource, signal = targetSignal,
start_day = "2020-02-15", end_day = fetchDate,
as_of = fetchDate,
geo_type = location)
Expand Down
3 changes: 2 additions & 1 deletion docker_dashboard/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ RUN install2.r --error \
aws.s3 \
covidcast \
stringr \
markdown
markdown \
memoise

COPY dist/*rds /srv/shiny-server/
COPY dashboard/* /srv/shiny-server/
Expand Down
3 changes: 3 additions & 0 deletions docker_dashboard/shiny_server.conf
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,8 @@ server {
# Disable some network protocols that are causing issues
disable_protocols websocket xdr-streaming xhr-streaming iframe-eventsource iframe-htmlfile;

# Set app timeout threshold to 4 hours
app_idle_timeout 14400;

}
}