Skip to content

Commit d456bd2

Browse files
committed
Merge branch 'dev' of https://github.com/cmu-delphi/www-main into unpack-cfr
2 parents 07cff15 + 8900c33 commit d456bd2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+9699
-6954
lines changed

.github/workflows/ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
${{ runner.os }}-conda6-
2525
- uses: conda-incubator/setup-miniconda@v2
2626
with:
27-
python-version: 3.7
27+
python-version: 3.9
2828
mamba-version: "*"
2929
channels: conda-forge,defaults
3030
channel-priority: true

.github/workflows/ci_fast.yaml

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -36,38 +36,33 @@ jobs:
3636
name: website
3737
path: ./public
3838

39-
- name: Configure AWS credentials
40-
uses: aws-actions/configure-aws-credentials@v1
39+
- name: Login to GitHub Container Registry
40+
uses: docker/login-action@v1
4141
with:
42-
aws-access-key-id: ${{ secrets.DELPHI_ECR_ACCESS_ID }}
43-
aws-secret-access-key: ${{ secrets.DELPHI_ECR_ACCESS_KEY }}
44-
aws-region: us-east-1
42+
registry: ghcr.io
43+
username: cmu-delphi-deploy-machine
44+
password: ${{ secrets.CMU_DELPHI_DEPLOY_MACHINE_PAT }}
4545

46-
- name: Login to Amazon ECR
47-
id: login-ecr
48-
uses: aws-actions/amazon-ecr-login@v1
49-
50-
- name: Build, tag, and push image to Amazon ECR
46+
- name: Build, tag, and push image to Github
5147
env:
52-
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
53-
ECR_REPOSITORY: ${{ github.event.repository.name }}
48+
DEVOPS_DOCKER_FILE: ./devops/precompiled.dockerfile
5449
run: |
5550
baseRef="${GITHUB_REF#*/}"
5651
baseRef="${baseRef#*/}"
5752
case "${baseRef}" in
5853
main)
59-
awsTag="latest"
54+
imageTag="latest"
6055
;;
6156
*)
62-
awsTag="${baseRef//\//_}" # replace `/` with `_` in branch name
57+
imageTag="${baseRef//\//_}" # replace `/` with `_` in branch name
6358
;;
6459
esac
65-
echo "using tag: --${awsTag}--"
66-
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$awsTag --file ./devops/precompiled/Dockerfile .
67-
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$awsTag
60+
echo "using tag: --${imageTag}--"
61+
docker build -t ghcr.io/${{ github.repository }}:$imageTag --file ${DEVOPS_DOCKER_FILE} .
62+
docker push ghcr.io/${{ github.repository }}:$imageTag
6863
6964
# trigger a webhook update
7065
curl -H "Authorization: Bearer ${{ secrets.DELPHI_DEPLOY_WEBHOOK_TOKEN }}" \
7166
-X POST ${{ secrets.DELPHI_DEPLOY_WEBHOOK_URL }} \
7267
-H "Content-Type: application/x-www-form-urlencoded" \
73-
-d "repository=$ECR_REGISTRY/$ECR_REPOSITORY&tag=$awsTag"
68+
-d "repository=ghcr.io/${{ github.repository }}&tag=$imageTag"

config.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,3 +111,9 @@ relativeURLs = false
111111
mission = "Develop the theory and practice of epidemiological forecasting, with a long-term vision of making this technology as universally accepted and useful as weather forecasting is today."
112112
apiUrl = "https://cmu-delphi.github.io/delphi-epidata"
113113
twitter = "CmuDelphi"
114+
feedbackForm = "https://docs.google.com/forms/d/e/1FAIpQLSeIeOJtrAhdOriEyiRY7LkpQX8DZBY19dl6De8l56Q9CZhmxw/viewform?usp=pp_url&entry.1245962748="
115+
feedbackLikelihoodMobile = 0.2
116+
feedbackLikelihoodDesktop = 1
117+
feedbackDelayMin = 10 # in sec
118+
feedbackDelayMax = 100 # in sec
119+
feedbackDuration = 60 # show it for 60sec

content/blog/2020-08-26-fb-survey.Rmd

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -149,22 +149,23 @@ df_in = covidcast_signal("jhu-csse", "confirmed_7dav_incidence_prop",
149149
df_fb_avg = df_fb %>% group_by(geo_value) %>% summarize(value = mean(value))
150150
df_in_avg = df_in %>% group_by(geo_value) %>% summarize(value = mean(value))
151151
152-
# Set a bunch of fields so that the data frames know how to plot themselves
153-
df_fb_avg$time_value = df_in_avg$time_value = start_day
154-
df_fb_avg$issue = df_in_avg$issue = start_day
155-
attributes(df_fb_avg)$metadata$geo_type = "state"
156-
attributes(df_in_avg)$metadata$geo_type = "state"
157-
class(df_fb_avg) = c("covidcast_signal", class(df_fb_avg))
158-
class(df_in_avg) = c("covidcast_signal", class(df_in_avg))
152+
# Turn these into covidcast_signal data frames that can be mapped
153+
df_fb_avg = df_fb_avg %>%
154+
mutate(time_value = start_day) %>%
155+
as.covidcast_signal(signal = "fb_avg", geo_type = "state")
156+
157+
df_in_avg = df_in_avg %>%
158+
mutate(time_value = start_day) %>%
159+
as.covidcast_signal(signal = "in_avg", geo_type = "state")
159160
160161
# Plot choropleth maps, using the covidcast plotting functionality
161162
subtitle = paste("Averaged over", start_day, "to", end_day)
162163
p1 = plot(df_fb_avg,
163164
title = "% of people with COVID symptoms, based on Facebook surveys",
164-
range=c(0, 1), choro_params = list(subtitle = subtitle))
165+
range = c(0, 1), choro_params = list(subtitle = subtitle))
165166
p2 = plot(df_in_avg,
166167
title = "Daily new confirmed COVID-19 cases per 100,000 people",
167-
range=c(0, 30), choro_params = list(subtitle = subtitle))
168+
range = c(0, 30), choro_params = list(subtitle = subtitle))
168169
grid.arrange(p1, p2, nrow = 1)
169170
```
170171

@@ -539,12 +540,13 @@ or we didn't have enough data from the surveys in
539540
order to estimate % CLI and % CLI-in-community signals there.
540541

541542
```{r, fig.width = 10, fig.height = 4, out.extra = 'class="wide-figure"'}
542-
# Set a bunch of fields so that the data frames know how to plot themselves
543-
df_cor1$time_value = df_cor2$time_value = start_day
544-
df_cor1$issue = df_cor2$issue = start_day
545-
attributes(df_cor1)$metadata$geo_type = "county"
546-
attributes(df_cor2)$metadata$geo_type = "county"
547-
class(df_cor1) = class(df_cor2) = c("covidcast_signal", "data.frame")
543+
# Use as.covidcast_signal to turn these into mappable signals
544+
df_cor1 = df_cor1 %>%
545+
mutate(time_value = start_day) %>%
546+
as.covidcast_signal(signal = "cor1")
547+
df_cor2 = df_cor2 %>%
548+
mutate(time_value = start_day) %>%
549+
as.covidcast_signal(signal = "cor1")
548550
549551
# Plot choropleth maps, using the covidcast plotting functionality
550552
p1 = plot(df_cor1, title = "Correlation between % CLI and case rates",

content/blog/2020-08-26-fb-survey.html

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
survey data. The COVIDcast API, which serves these estimates and is updated
3737
daily, is a much larger effort run by the Delphi group, and our entire
3838
engineering team is owed a lot of credit here. Ryan came up with the
39-
idea of running the surveys, and worked with Facebook to make this a reality.
39+
idea of running the surveys, and worked with Facebook to make this a reality.
4040
On the Facebook side, Curtiss Cobb and Jonathan McKay played big roles. The
4141
University of Maryland team, including Adrianne Bradford and Samantha Chiu and
4242
led by Frauke Kreuter, made many contributions to the survey design.
@@ -47,7 +47,6 @@
4747
toc: true
4848
---
4949

50-
<script src="/rmarkdown-libs/header-attrs/header-attrs.js"></script>
5150
<link href="/rmarkdown-libs/anchor-sections/anchor-sections.css" rel="stylesheet" />
5251
<script src="/rmarkdown-libs/anchor-sections/anchor-sections.js"></script>
5352

@@ -57,8 +56,7 @@
5756
<li><a href="#why-run-these-surveys">Why Run These Surveys?</a></li>
5857
<li><a href="#whats-in-the-survey">What’s in the Survey?</a></li>
5958
<li><a href="#some-interesting-examples">Some Interesting Examples</a></li>
60-
<li><a href="#basic-correlation-analysis">Basic Correlation Analysis</a>
61-
<ul>
59+
<li><a href="#basic-correlation-analysis">Basic Correlation Analysis</a><ul>
6260
<li><a href="#correlations-sliced-by-time">Correlations Sliced by Time</a></li>
6361
<li><a href="#correlations-sliced-by-county">Correlations Sliced by County</a></li>
6462
</ul></li>
@@ -156,22 +154,23 @@ <h2>Short Background</h2>
156154
df_fb_avg = df_fb %&gt;% group_by(geo_value) %&gt;% summarize(value = mean(value))
157155
df_in_avg = df_in %&gt;% group_by(geo_value) %&gt;% summarize(value = mean(value))
158156

159-
# Set a bunch of fields so that the data frames know how to plot themselves
160-
df_fb_avg$time_value = df_in_avg$time_value = start_day
161-
df_fb_avg$issue = df_in_avg$issue = start_day
162-
attributes(df_fb_avg)$metadata$geo_type = &quot;state&quot;
163-
attributes(df_in_avg)$metadata$geo_type = &quot;state&quot;
164-
class(df_fb_avg) = c(&quot;covidcast_signal&quot;, class(df_fb_avg))
165-
class(df_in_avg) = c(&quot;covidcast_signal&quot;, class(df_in_avg))
157+
# Turn these into covidcast_signal data frames that can be mapped
158+
df_fb_avg = df_fb_avg %&gt;%
159+
mutate(time_value = start_day) %&gt;%
160+
as.covidcast_signal(signal = &quot;fb_avg&quot;, geo_type = &quot;state&quot;)
161+
162+
df_in_avg = df_in_avg %&gt;%
163+
mutate(time_value = start_day) %&gt;%
164+
as.covidcast_signal(signal = &quot;in_avg&quot;, geo_type = &quot;state&quot;)
166165

167166
# Plot choropleth maps, using the covidcast plotting functionality
168167
subtitle = paste(&quot;Averaged over&quot;, start_day, &quot;to&quot;, end_day)
169168
p1 = plot(df_fb_avg,
170169
title = &quot;% of people with COVID symptoms, based on Facebook surveys&quot;,
171-
range=c(0, 1), choro_params = list(subtitle = subtitle))
170+
range = c(0, 1), choro_params = list(subtitle = subtitle))
172171
p2 = plot(df_in_avg,
173172
title = &quot;Daily new confirmed COVID-19 cases per 100,000 people&quot;,
174-
range=c(0, 30), choro_params = list(subtitle = subtitle))
173+
range = c(0, 30), choro_params = list(subtitle = subtitle))
175174
grid.arrange(p1, p2, nrow = 1)</code></pre>
176175
<p><img src="/blog/2020-08-26-fb-survey_files/figure-html/unnamed-chunk-2-1.svg" width="960" class="wide-figure" /></p>
177176
<p>We generated these plots using our <a href="https://cmu-delphi.github.io/covidcast/covidcastR/">covidcast R
@@ -517,12 +516,13 @@ <h3>Correlations Sliced by County</h3>
517516
either that county had below 500 cumulative COVID-19 cases,
518517
or we didn’t have enough data from the surveys in
519518
order to estimate % CLI and % CLI-in-community signals there.</p>
520-
<pre class="r"><code># Set a bunch of fields so that the data frames know how to plot themselves
521-
df_cor1$time_value = df_cor2$time_value = start_day
522-
df_cor1$issue = df_cor2$issue = start_day
523-
attributes(df_cor1)$metadata$geo_type = &quot;county&quot;
524-
attributes(df_cor2)$metadata$geo_type = &quot;county&quot;
525-
class(df_cor1) = class(df_cor2) = c(&quot;covidcast_signal&quot;, &quot;data.frame&quot;)
519+
<pre class="r"><code># Use as.covidcast_signal to turn these into mappable signals
520+
df_cor1 = df_cor1 %&gt;%
521+
mutate(time_value = start_day) %&gt;%
522+
as.covidcast_signal(signal = &quot;cor1&quot;)
523+
df_cor2 = df_cor2 %&gt;%
524+
mutate(time_value = start_day) %&gt;%
525+
as.covidcast_signal(signal = &quot;cor1&quot;)
526526

527527
# Plot choropleth maps, using the covidcast plotting functionality
528528
p1 = plot(df_cor1, title = &quot;Correlation between % CLI and case rates&quot;,

content/blog/2020-10-14-dv-signal.Rmd

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -89,13 +89,13 @@ df_in = covidcast_signal("usa-facts", "confirmed_7dav_incidence_prop",
8989
df_dv_avg = df_dv %>% group_by(geo_value) %>% summarize(value = mean(value))
9090
df_in_avg = df_in %>% group_by(geo_value) %>% summarize(value = mean(value))
9191
92-
# Set a bunch of fields so that the data frames know how to plot themselves
93-
df_dv_avg$time_value = df_in_avg$time_value = start_day
94-
df_dv_avg$issue = df_in_avg$issue = start_day
95-
attributes(df_dv_avg)$metadata$geo_type = "state"
96-
attributes(df_in_avg)$metadata$geo_type = "state"
97-
class(df_dv_avg) = c("covidcast_signal", class(df_dv_avg))
98-
class(df_in_avg) = c("covidcast_signal", class(df_in_avg))
92+
# Use as.covidcast_signal to turn these into covidcast data frames
93+
df_dv_avg <- df_dv_avg %>%
94+
mutate(time_value = start_day) %>%
95+
as.covidcast_signal(signal = "dv_avg", geo_type = "state")
96+
df_in_avg <- df_in_avg %>%
97+
mutate(time_value = start_day) %>%
98+
as.covidcast_signal(signal = "in_avg", geo_type = "state")
9999
100100
# Plot choropleth maps, using the covidcast plotting functionality
101101
subtitle = paste("Averaged over", start_day, "to", end_day)
@@ -337,8 +337,12 @@ lm_dv_cases_df = dv_cases_df %>%
337337
ungroup()
338338
339339
df_cor_by_time_adj = covidcast_cor(
340-
dv_cases_df %>% mutate(value = dv*slope_6wk + int_6wk, issue = time_value),
341-
dv_cases_df %>% mutate(value = cases, issue = time_value),
340+
dv_cases_df %>%
341+
mutate(value = dv*slope_6wk + int_6wk, issue = time_value) %>%
342+
as.covidcast_signal(signal = "dv_cases"),
343+
dv_cases_df %>%
344+
mutate(value = cases, issue = time_value) %>%
345+
as.covidcast_signal(signal = "dv_cases"),
342346
by = "time_value",
343347
method = "spearman")
344348

content/blog/2020-10-14-dv-signal.html

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
summary: |
1818
In previous posts, we discussed our massive ongoing symptom surveys that have reached over 12 million people in the U.S. since April 2020, in partnership with Facebook and Google. Another one of our major data initiatives is based on partnerships with healthcare systems, granting us access to various aggregate statistics from hospital records and insurance claims covering 10-15% of the United States population. From these data, we can extract informative indicators that can be early indicators of COVID activity. This post focuses on one indicator in particular, based on outpatient visits, and demonstrates both the challenges and promises associated with medical records data.
1919
acknowledgements: |
20-
Maria Jahja contributed immensely to every stage of this project, from determining which ICD codes to use to the final implementation of the indicator.
21-
Aaron Rumack devised the weekday adjustment and analyzed the performance of the DV indicator.
20+
Maria Jahja contributed immensely to every stage of this project, from determining which ICD codes to use to the final implementation of the indicator.
21+
Aaron Rumack devised the weekday adjustment and analyzed the performance of the DV indicator.
2222
Roni Rosenfeld worked closely with our health systems partners to get access to the data and provided domain knowledge to ensure that the data was useful. Both Roni and Ryan Tibshirani provided helpful suggestions and insights towards the methodology and analysis.
2323

2424
output:
@@ -28,7 +28,6 @@
2828
toc: true
2929
---
3030

31-
<script src="/rmarkdown-libs/header-attrs/header-attrs.js"></script>
3231
<link href="/rmarkdown-libs/anchor-sections/anchor-sections.css" rel="stylesheet" />
3332
<script src="/rmarkdown-libs/anchor-sections/anchor-sections.js"></script>
3433

@@ -88,13 +87,13 @@ <h2>The Doctor Visits Indicator</h2>
8887
df_dv_avg = df_dv %&gt;% group_by(geo_value) %&gt;% summarize(value = mean(value))
8988
df_in_avg = df_in %&gt;% group_by(geo_value) %&gt;% summarize(value = mean(value))
9089

91-
# Set a bunch of fields so that the data frames know how to plot themselves
92-
df_dv_avg$time_value = df_in_avg$time_value = start_day
93-
df_dv_avg$issue = df_in_avg$issue = start_day
94-
attributes(df_dv_avg)$metadata$geo_type = &quot;state&quot;
95-
attributes(df_in_avg)$metadata$geo_type = &quot;state&quot;
96-
class(df_dv_avg) = c(&quot;covidcast_signal&quot;, class(df_dv_avg))
97-
class(df_in_avg) = c(&quot;covidcast_signal&quot;, class(df_in_avg))
90+
# Use as.covidcast_signal to turn these into covidcast data frames
91+
df_dv_avg &lt;- df_dv_avg %&gt;%
92+
mutate(time_value = start_day) %&gt;%
93+
as.covidcast_signal(signal = &quot;dv_avg&quot;, geo_type = &quot;state&quot;)
94+
df_in_avg &lt;- df_in_avg %&gt;%
95+
mutate(time_value = start_day) %&gt;%
96+
as.covidcast_signal(signal = &quot;in_avg&quot;, geo_type = &quot;state&quot;)
9897

9998
# Plot choropleth maps, using the covidcast plotting functionality
10099
subtitle = paste(&quot;Averaged over&quot;, start_day, &quot;to&quot;, end_day)
@@ -317,8 +316,12 @@ <h2>Spatial Heterogeneity</h2>
317316
ungroup()
318317

319318
df_cor_by_time_adj = covidcast_cor(
320-
dv_cases_df %&gt;% mutate(value = dv*slope_6wk + int_6wk, issue = time_value),
321-
dv_cases_df %&gt;% mutate(value = cases, issue = time_value),
319+
dv_cases_df %&gt;%
320+
mutate(value = dv*slope_6wk + int_6wk, issue = time_value) %&gt;%
321+
as.covidcast_signal(signal = &quot;dv_cases&quot;),
322+
dv_cases_df %&gt;%
323+
mutate(value = cases, issue = time_value) %&gt;%
324+
as.covidcast_signal(signal = &quot;dv_cases&quot;),
322325
by = &quot;time_value&quot;,
323326
method = &quot;spearman&quot;)
324327

0 commit comments

Comments
 (0)