nrsander / covid-data-model

Data backend providing computed data for the graphs displayed at https://covidactnow.org

Home Page:https://covidactnow.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

COVID-19 Data Model

Objective: Provide a library/API that ingests COVID-19 data to provide simulated outcomes based on local isolation/quarantine policy levers as represented in published models.

Check It Out in Jupyter Binder

Resources

Models

Data Sources

See covid-data-public for data sources being used or considered.

API Snapshots

We automatically build & publish an API snapshot (e.g. https://data.covidactnow.org/snapshot/123/) twice a day via a github action. To manually kick off a new snapshot, get a personal access token, and run:

export GITHUB_TOKEN=<YOUR PERSONAL GITHUB TOKEN>
./tools/push-api.sh

Once a snapshot has been vetted, you can "label" it with a friendly name, e.g. pointing https://data.covidactnow.org/v0/ at https://data.covidactnow.org/snapshot/123/ with:

export GITHUB_TOKEN=<YOUR PERSONAL GITHUB TOKEN>
./tools/label-api.sh v0 123

Development

Run website data deploy

This will run all models and generate data needed for the website, outputting to ../covid-projections/public/data.

./deploy_website.sh

Sentry

In order to have sentry run locally and report errors to the dev sentry instance, add the following to your .env

export SENTRY_DSN=https://<GET_SENTRY_DSN_FOR_DEV_INSTANCE>.ingest.sentry.io/<DEV_INSTANCE>

The gitub action pulls the sentry_dsn for the prod instance from a secrets stored within github.

PySEIR Setup

Installation

Recommend virtualenv or miniconda python 3.7 from here https://docs.conda.io/en/latest/miniconda.html

If using conda, you can use the following:

  • conda create python=3.7 -n covid-data-model
  • conda activate covid-data-model
  • pip install -r requirements.txt -r requirements_test.txt

Running Models

PySEIR provides a command line interface in the activated environment. You can access the model with pyseir --help and pyseir <subcommand> --help providing more information.

Example: pyseir build-all --states="New York" will run state and county models for New York. States can also be specified by their state code: --states="New York" and --states=NY are equivalent.

Check the output/ folder for results.

Model Output

There are a variety of output artifacts to paths described in pyseir/utils.py. The main artifact is the ensemble_result which contains the output information for each suppression policy -> model compartment as well as capacity information.

About

Data backend providing computed data for the graphs displayed at https://covidactnow.org

https://covidactnow.org/

License:MIT License


Languages

Language:Python 74.4%Language:Jupyter Notebook 24.5%Language:Shell 1.1%Language:Makefile 0.0%