Skip to content

Release Delphi Epidata 0.3.21 #970

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 40 commits into from
Sep 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
4b6bcdc
Merge pull request #921 from cmu-delphi/bot/sync-main-dev
krivard May 31, 2022
192efed
update codebook
nmdefries Jun 7, 2022
5f51a37
describe new fields
nmdefries Jun 7, 2022
80ae21b
Merge pull request #928 from cmu-delphi/ndefries/newest-codebook
capnrefsmmat Jun 8, 2022
2d2d387
Local-development helper scripts
krivard Oct 24, 2021
7c96584
Add quickstart instructions to developer guide
krivard Oct 24, 2021
fafb268
Remove superfluous chmod
krivard Oct 24, 2021
bef7833
Apply suggestions from code review
krivard Mar 8, 2022
a3cf65b
Merge pull request #752 from cmu-delphi/krivard/gentle-development
krivard Jun 21, 2022
184a385
Add Docker controller Makefile and boostrap script
dshemetov Jun 18, 2022
ed49dab
Apply suggestions from code review
dshemetov Jun 24, 2022
8e2ca14
Implement changes from review
dshemetov Jun 25, 2022
277db7d
Update epidata dev doc commands
dshemetov Jun 25, 2022
3f26e09
Minor docstring change
dshemetov Jun 25, 2022
75dc023
Fix docker stop commands to fail correctly
dshemetov Jun 27, 2022
df9bef0
Merge pull request #936 from cmu-delphi/ds/dev-tools
krivard Jun 28, 2022
b3ebbac
Bump tzinfo from 1.2.9 to 1.2.10 in /docs
dependabot[bot] Jul 22, 2022
3f0ff0f
Merge pull request #946 from cmu-delphi/dependabot/bundler/docs/tzinf…
krivard Jul 22, 2022
73f11b7
1. Reformat the table
LeonLu2 Aug 16, 2022
ff44f51
1. change the description to align at left
LeonLu2 Aug 24, 2022
289c0a9
Update README.md with dev quickstart recipes
dshemetov Aug 25, 2022
473b851
Move quickstart up further for maximum obviousness
krivard Aug 25, 2022
00093dc
Explain dev quickstart directory structure
dshemetov Aug 25, 2022
ee9ce6c
Merge pull request #957 from cmu-delphi/krivard/ds-update-readme
dshemetov Aug 25, 2022
46f19a5
Merge branch 'ds/update-readme' of https://github.com/cmu-delphi/delp…
dshemetov Aug 25, 2022
d047a8c
1. reformat the table for JHU and USAFacts page
LeonLu2 Aug 26, 2022
2772feb
1. indicate the standard error and sample sizes are not available/app…
LeonLu2 Aug 26, 2022
7c3fc8b
HHS docs: linebreak to fix excessive column width
krivard Aug 26, 2022
b44473e
Merge pull request #952 from cmu-delphi/leonlu2/bad-table
krivard Aug 26, 2022
90798f9
Deactivate SafeGraph Weekly Patterns signals.
krivard Jun 16, 2022
dcb36d8
Fix a typo, few past tense changes
dshemetov Aug 29, 2022
d3eb8d5
Merge pull request #932 from cmu-delphi/krivard/deactivate-safegraph
krivard Aug 30, 2022
d2a5b25
Merge pull request #961 from cmu-delphi/leonlu2/CHNG
krivard Aug 30, 2022
95d69dd
Merge pull request #956 from cmu-delphi/ds/update-readme
krivard Aug 30, 2022
2e0f05d
Move survey to past-tense
capnrefsmmat Sep 2, 2022
c994418
Refer to Methodology Report in a few places
capnrefsmmat Sep 2, 2022
b94b5a4
1. updated the available for line
LeonLu2 Sep 3, 2022
3284a73
Merge pull request #969 from cmu-delphi/leonlu2/JHU-Docs
krivard Sep 6, 2022
607e268
Merge pull request #968 from cmu-delphi/surveys/methodology-report
krivard Sep 6, 2022
6ea028f
chore: release delphi-epidata 0.3.21
krivard Sep 6, 2022
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 .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.3.20
current_version = 0.3.21
commit = False
tag = False

Expand Down
46 changes: 45 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,51 @@ This is the home of [Delphi](https://delphi.cmu.edu/)'s epidemiological data
API. See our [API documentation](https://cmu-delphi.github.io/delphi-epidata/)
for details on the available data sets, APIs, and clients.

## COVIDcast
## Development Quickstart

Requires: Docker, possibly sudo access (depending on your Docker installation and OS).

In the directory where you want to work run the following:

```sh
# Make folder structure, download dependent repos, and symlink Makefile
$ curl "https://raw.githubusercontent.com/cmu-delphi/delphi-epidata/dev/dev/local/install.sh" | bash
```

You should now have the following directory structure:

```sh
├── driver
│ ├── .dockerignore -> repos/delphi/delphi-epidata/dev/local/.dockerignore
│ ├── Makefile -> repos/delphi/delphi-epidata/dev/local/Makefile
│ ├── repos
│ │ └── delphi
│ │ ├── delphi-epidata
│ │ ├── flu-contest
│ │ ├── github-deploy-repo
│ │ ├── nowcast
│ │ ├── operations
│ │ └── utils
```

and you should now be in the `driver` directory.
You can now execute make commands

```sh
# Create all docker containers: db, web, and python
$ [sudo] make all

# Run tests
$ [sudo] make test

# To drop into debugger on error
$ [sudo] make test pdb=1

# To test only a subset of tests
$ [sudo] make test test=repos/delphi/delphi-epidata/integrations/acquisition
```

# COVIDcast

At the present, our primary focus is developing and expanding the
[COVIDcast API](https://cmu-delphi.github.io/delphi-epidata/api/covidcast.html),
Expand Down
6 changes: 6 additions & 0 deletions dev/local/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Ignore everything by default
*
# Don't ignore repos dir
!repos
# Ignore everything to do with git
**/*.git
140 changes: 140 additions & 0 deletions dev/local/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
# Docker control panel for delphi-epidata development.
#
# Usage: make <command> [pdb=1] [test=<test-subdir>]
#
# Assumes you have installed your environment using
# delphi-epidata/dev/local/install.sh.
#
# Checks for the delphi-net bridge and creates if it doesn't exist.
#
# Creates all prereq images (delphi_database, delphi_python) only if they don't
# exist. If you need to rebuild a prereq, you're probably doing something
# complicated, and can figure out the rebuild command on your own.
#
#
# Commands:
#
# web: Stops currently-running delphi_web_epidata instances, if any.
# Rebuilds delphi_web_epidata image.
# Runs image in the background and pipes stdout to a log file.
#
# db: Stops currently-running delphi_database_epidata instances, if any.
# Rebuilds delphi_database_epidata image.
# Runs image in the background and pipes stdout to a log file.
# Blocks until database is ready to receive connections.
#
# python: Rebuilds delphi_web_python image. You shouldn't need to do this
# often; only if you are installing a new environment, or have
# made changes to delphi-epidata/dev/docker/python/Dockerfile.
#
# all: Runs the commands 'web' 'db' and 'python'.
#
# test: Runs test and integrations in delphi-epidata. If test
# optional arg is provided, then only the tests in that subdir
# are run.
#
# clean: Cleans up dangling Docker images.
#
#
# Optional arguments:
# pdb=1 Drops you into debug mode upon test failure, if running tests.
# test= Only runs tests in the directories provided here, e.g.
# repos/delphi/delphi-epidata/tests/acquisition/covidcast


# Set optional argument defaults
ifdef pdb
override pdb=--pdb
else
pdb=
endif

ifndef test
test=repos/delphi/delphi-epidata/tests repos/delphi/delphi-epidata/integrations
endif

SHELL:=/bin/sh

# Get the Makefile's absolute path: https://stackoverflow.com/a/324782/4784655
# (if called from a symlink, the path is the location of the symlink)
CWD:=$(dir $(abspath $(lastword $(MAKEFILE_LIST))))
NOW:=$(shell date "+%Y-%m-%d")
LOG_WEB:=delphi_web_epidata_$(NOW).log
LOG_DB:=delphi_database_epidata_$(NOW).log
WEB_CONTAINER_ID:=$(shell docker ps -q --filter 'name=delphi_web_epidata')
DATABASE_CONTAINER_ID:=$(shell docker ps -q --filter 'name=delphi_database_epidata')


.PHONY=web
web:
@# Stop container if running
@if [ $(WEB_CONTAINER_ID) ]; then\
docker stop $(WEB_CONTAINER_ID);\
fi

@# Setup virtual network if it doesn't exist
@docker network ls | grep delphi-net || docker network create --driver bridge delphi-net

@# Build the web_epidata image
@cd repos/delphi/delphi-epidata;\
docker build -t delphi_web_epidata -f ./devops/Dockerfile .;\
cd ../../../

@# Run the web server
@docker run --rm -p 127.0.0.1:10080:80 \
--env "SQLALCHEMY_DATABASE_URI=mysql+mysqldb://user:pass@delphi_database_epidata:3306/epidata" \
--env "FLASK_SECRET=abc" --env "FLASK_PREFIX=/epidata" \
--network delphi-net --name delphi_web_epidata \
delphi_web_epidata >$(LOG_WEB) 2>&1 &

.PHONY=db
db:
@# Stop container if running
@if [ $(DATABASE_CONTAINER_ID) ]; then\
docker stop $(DATABASE_CONTAINER_ID);\
fi

@# Only build prereqs if we need them
@docker images delphi_database | grep delphi || \
docker build -t delphi_database -f repos/delphi/operations/dev/docker/database/Dockerfile .

@# Build the database_epidata image
@docker build -t delphi_database_epidata \
-f repos/delphi/delphi-epidata/dev/docker/database/epidata/Dockerfile .

@# Run the database
@docker run --rm -p 127.0.0.1:13306:3306 \
--network delphi-net --name delphi_database_epidata \
delphi_database_epidata >$(LOG_DB) 2>&1 &

@# Block until DB is ready
@while true; do \
sed -n '/Temporary server stopped/,/mysqld: ready for connections/p' $(LOG_DB) | grep "ready for connections" && break; \
tail -1 $(LOG_DB); \
sleep 1; \
done

.PHONY=py
py:
@# Build the python image
@docker build -t delphi_python \
-f repos/delphi/operations/dev/docker/python/Dockerfile .

@docker build -t delphi_web_python \
-f repos/delphi/delphi-epidata/dev/docker/python/Dockerfile .

.PHONY=all
all: web db py

.PHONY=test
test:
@docker run -i --rm --network delphi-net \
--mount type=bind,source=$(CWD)repos/delphi/delphi-epidata,target=/usr/src/app/repos/delphi/delphi-epidata,readonly \
--mount type=bind,source=$(CWD)repos/delphi/delphi-epidata/src,target=/usr/src/app/delphi/epidata,readonly \
--env "SQLALCHEMY_DATABASE_URI=mysql+mysqldb://user:pass@delphi_database_epidata:3306/epidata" \
--env "FLASK_SECRET=abc" \
delphi_web_python python -m pytest --import-mode importlib $(pdb) $(test) | tee test_output_$(NOW).log

.PHONY=clean
clean:
@docker images -f "dangling=true" -q | xargs docker rmi >/dev/null 2>&1
45 changes: 45 additions & 0 deletions dev/local/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#!/bin/bash
# Bootstrap delphi-epidata development
#
# Downloads the repos needed for local delphi-epidata development into current dir
# and provides a Makefile with Docker control commands.
#
# Creates the directory structure:
#
# driver/
# .dockerignore
# Makefile
# repos/
# delphi/
# operations/
# delphi-epidata/
# utils/
# flu-contest/
# nowcast/
# github-deploy-repo/
# undefx/
# py3tester/
# undef-analysis/
#
# Leaves you in driver, the main workdir.
#


mkdir -p driver/repos/delphi
cd driver/repos/delphi
git clone https://github.com/cmu-delphi/operations
git clone https://github.com/cmu-delphi/delphi-epidata
git clone https://github.com/cmu-delphi/utils
git clone https://github.com/cmu-delphi/flu-contest
git clone https://github.com/cmu-delphi/nowcast
git clone https://github.com/cmu-delphi/github-deploy-repo
cd ../../

mkdir -p repos/undefx
cd repos/undefx
git clone https://github.com/undefx/py3tester
git clone https://github.com/undefx/undef-analysis
cd ../../

ln -s repos/delphi/delphi-epidata/dev/local/Makefile
ln -s repos/delphi/delphi-epidata/dev/local/.dockerignore
2 changes: 1 addition & 1 deletion docs/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ GEM
thread_safe (0.3.6)
typhoeus (1.4.0)
ethon (>= 0.9.0)
tzinfo (1.2.9)
tzinfo (1.2.10)
thread_safe (~> 0.1)
tzinfo-data (1.2021.1)
tzinfo (>= 1.0.0)
Expand Down
2 changes: 1 addition & 1 deletion docs/api/covidcast-signals/chng.md
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ all of them, and so this source only represents those encounters known to
them. Their coverage may vary across the United States, but they report on about
45% of all doctor's visits nationally.

Standard errors are not available for this data source.
Standard errors and sample sizes are not available for this data source.

Due to changes in medical-seeking behavior on holidays, this data source has
upward spikes in the fraction of doctor's visits that are COVID-related around
Expand Down
2 changes: 1 addition & 1 deletion docs/api/covidcast-signals/doctor-visits.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ outpatient doctor's visits, but not all of them, and so this source only
represents those visits known to them. Their coverage may vary across the United
States.

Standard errors are not available for this data source.
Standard errors and sample sizes are not available for this data source.

Due to changes in medical-seeking behavior on holidays, this data source has
upward spikes in the fraction of doctor's visits that are COVID-related around
Expand Down
2 changes: 2 additions & 0 deletions docs/api/covidcast-signals/dsew-cpr.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ This data source is susceptible to large corrections that can create strange dat

Not all CPRs have the same lag between the CPR date (listed in the filename) and the date for a particular signal.

Standard errors and sample sizes are not applicable to these metrics.

### Differences with HHS reports

An analysis comparing the
Expand Down
9 changes: 5 additions & 4 deletions docs/api/covidcast-signals/fb-survey.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,18 @@ grand_parent: COVIDcast Epidata API

This data source is based on the [COVID-19 Trends and Impact Survey (CTIS)](../../symptom-survey/)
run by the Delphi group at Carnegie Mellon.
Facebook directs a random sample of its users to these surveys, which are
voluntary. Users age 18 or older are eligible to complete the surveys, and
Facebook directed a random sample of its users to these surveys, which were
voluntary. Users age 18 or older were eligible to complete the surveys, and
their survey responses are held by CMU and are sharable with other health
researchers under a data use agreement. No individual survey responses are
shared back to Facebook. See our [surveys
page](https://delphi.cmu.edu/covid19/ctis/) for more detail about how the
surveys work and how they are used outside the COVIDcast API.

As of November 2021, the average number of Facebook survey responses we
receive each day is about 40,000, and the total number of survey responses we
have received is over 25 million.
received each day was about 40,000. The survey ran from April 6, 2020 to June
25, 2022, collecting roughly 29.5 million responses in the United States in that
time.

We produce several sets of signals based on the survey data, listed and
described in the sections below:
Expand Down
2 changes: 2 additions & 0 deletions docs/api/covidcast-signals/google-symptoms.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ popularity of symptoms in searches within each geographical region individually.
This means that the resulting values of symptom set popularity are **NOT**
comparable across geographic regions, while the values of different symptom sets are comparable within the same location.

Standard errors and sample sizes are not available for this data source.

More details about the limitations of this dataset are available in [Google's Search
Trends symptoms dataset documentation](https://storage.googleapis.com/gcp-public-data-symptom-search/COVID-19%20Search%20Trends%20symptoms%20dataset%20documentation%20.pdf).

Expand Down
19 changes: 11 additions & 8 deletions docs/api/covidcast-signals/hhs.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,16 @@ adult and pediatric COVID-19 hospital admissions. This sum is used as the
We also include influenza hospital admissions.


| Signal | 7-day average signal | Geography | Resolution | Description |
| --- | --- | --- | --- | --- |
| `confirmed_admissions_covid_1d` | `confirmed_admissions_covid_1d_7dav`| state | 1 day | Sum of adult and pediatric confirmed COVID-19 hospital admissions occurring each day. <br/> **Earliest date available:** 2019-12-31 |
| `confirmed_admissions_covid_1d_prop` | `confirmed_admissions_covid_1d_prop_7dav`| state | 1 day | Sum of adult and pediatric confirmed COVID-19 hospital admissions occurring each day, per 100,000 population. <br/> **Earliest date available:** 2019-12-31 |
| `sum_confirmed_suspected_admissions_covid_1d` | `sum_confirmed_suspected_admissions_covid_1d_7dav` | state | 1 day | Sum of adult and pediatric confirmed and suspected COVID-19 hospital admissions occurring each day. <br/> **Earliest date available:** 2019-12-31 |
| `sum_confirmed_suspected_admissions_covid_1d_prop` | `sum_confirmed_suspected_admissions_covid_1d_prop_7dav` | state | 1 day | Sum of adult and pediatric confirmed and suspected COVID-19 hospital admissions occurring each day, per 100,000 population. <br/> **Earliest date available:** 2019-12-31 |
| `confirmed_admissions_influenza_1d` | `confirmed_admissions_influenza_1d_7dav` | state | 1 day | All confirmed influenza hospital admissions occurring each day. We made this signal available November 1, 2021. <br/> **Earliest issue available:** 2021-09-20 <br/> **Earliest date available:** 2020-01-02 |
| `confirmed_admissions_influenza_1d_prop` | `confirmed_admissions_influenza_1d_prop_7dav` | state | 1 day | All confirmed influenza hospital admissions occurring each day, per 100,000 population. We made this signal available November 1, 2021. <br/> **Earliest issue available:** 2021-09-20 <br/> **Earliest date available:** 2020-01-02 |
| Signal and 7-day average signal | Description |
|:---------------------------------------------------------------------------------------------------------------|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `confirmed_admissions_covid_1d` and `confirmed_admissions_covid_1d_7dav` | Sum of adult and pediatric confirmed COVID-19 hospital admissions occurring each day. <br/> **Earliest date available:** 2019-12-31 |
| `confirmed_admissions_covid_1d_prop` and `confirmed_admissions_covid_1d_prop_7dav` | Sum of adult and pediatric confirmed COVID-19 hospital admissions occurring each day, per 100,000 population. <br/> **Earliest date available:** 2019-12-31 |
| `sum_confirmed_suspected_admissions_covid_1d` and `sum_confirmed_suspected_admissions_covid_1d_7dav` | Sum of adult and pediatric confirmed and suspected COVID-19 hospital admissions occurring each day. <br/> **Earliest date available:** 2019-12-31 |
| `sum_confirmed_suspected_admissions_covid_1d_prop` and <br/> `sum_confirmed_suspected_admissions_covid_1d_prop_7dav` | Sum of adult and pediatric confirmed and suspected COVID-19 hospital admissions occurring each day, per 100,000 population. <br/> **Earliest date available:** 2019-12-31 |
| `confirmed_admissions_influenza_1d` and `confirmed_admissions_influenza_1d_7dav` | All confirmed influenza hospital admissions occurring each day. We made this signal available November 1, 2021. <br/> **Earliest issue available:** 2021-09-20 <br/> **Earliest date available:** 2020-01-02 |
| `confirmed_admissions_influenza_1d_prop` and `confirmed_admissions_influenza_1d_prop_7dav` | All confirmed influenza hospital admissions occurring each day, per 100,000 population. We made this signal available November 1, 2021. <br/> **Earliest issue available:** 2021-09-20 <br/> **Earliest date available:** 2020-01-02 |

*for all the above signals & 7-day average signals, their geography is state, and resolution is 1 day.

The 7-day average signals are computed by Delphi by calculating
moving averages of the preceding 7 days, so e.g. the signal for June 7 is the
Expand Down Expand Up @@ -96,6 +97,8 @@ psychiatric and rehabilitation facilities, Indian Health Service (IHS)
facilities, U.S. Department of Veterans Affairs (VA) facilities, Defense Health
Agency (DHA) facilities, and religious non-medical facilities.

Standard errors and sample sizes are not applicable to these metrics.

## Lag and Backfill

HHS issues updates to this timeseries once a week, and occasionally more
Expand Down
2 changes: 2 additions & 0 deletions docs/api/covidcast-signals/hospital-admissions.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ hospitalizations, but not all of them, and so this source only represents those
hospitalizations known to them. Their coverage may vary across the United
States.

Standard errors and sample sizes are not available for this data source.

## Qualifying Admissions

We receive two daily data streams of new hospital admissions recorded by the health system partners at each location. One stream is based on electronic medical records, and the other comes from claims records.
Expand Down
Loading