Giter Club home page Giter Club logo

pandemic51's Introduction

pandemic51

Voxel51's website for monitoring the impact of the Coronavirus pandemic. See it live at https://pdi.voxel51.com.

voxel51-logo.png

Organization

.
├── api                      <-- API definition
├── config                   <-- config files and templates
├── pandemic51               <-- core backend libary
├── README.md                <-- this README
├── scripts                  <-- handy scripts
└── web                      <-- web client

Installation

Clone the repository

git clone https://github.com/voxel51/pandemic51

Environment variables and configuration

Add the following to your ~/.bash_profile or ~/.bashrc, setting {{CWD}} to your current working directory and setting your MySQL username and password:

# Pandemic51 resources
export P51_BASE_DIR="{{CWD}}"
export P51_REPO_DIR="${P51_BASE_DIR}/pandemic51"
export P51_CELERY_DIR="${P51_BASE_DIR}/celery"
export P51_DATA_DIR="${P51_BASE_DIR}/data"
export P51_SQL_USERNAME="{{USERNAME}}"
export P51_SQL_PASSWORD="{{PASSWORD}}"
export P51_SQL_DATABASE_NAME=p51db

# Login shortcut
alias p51mysql="mysql -u ${P51_SQL_USERNAME} -p${P51_SQL_PASSWORD} ${P51_SQL_DATABASE_NAME}"

With the above in-place, source your config to apply the changes.

Next, create a pandemic51/config.py from the provided template:

cp config/config-template.py pandemic51/config.py

and customize any values as needed. Be sure to match P51_SQL_USERNAME and P51_SQL_PASSWORD to the values you set to your environment variables.

Pre-installation

For Linux users, run the scripts/linux_preinstall.bash script.

todo: finish MacOS preinstall script

Then download chromedriver for your version of Google Chrome and move it to /usr/bin/.

We strongly recommend creating a virtual environment for your development work:

ENV_DIR=/path/for/your/venv

virtualenv -p /usr/local/bin/python3.6 ${ENV_DIR}/covid19
source ${ENV_DIR}/covid19/bin/activate

Installation

Run the install script:

bash install.bash

Initialize the database

bash scripts/init_db.bash

This can be run at anytime to wipe the database.

Initialize Celery

Celery is configured for Linux as a systemd daemon.

todo: make a configuration for MacOS with launchd

First, create copies of the Celery templates:

cp config/celery-template.conf config/celery.conf
cp config/celery-template.service config/celery.service
cp config/celerybeat-template.service config/celerybeat.service

and fill in all {{VALUE}} placeholders with the appropriate values.

Then place celery.service & celerybeat.service in /lib/systemd/system:

mv config/celery.service /lib/systemd/system
mv config/celerybeat.service /lib/systemd/system

and start the services using the instructions below.

Celery cheatsheet

Any time a file is added or modified in /lib/systemd/system, run:

sudo systemctl daemon-reload

Control the celery/celerybeat services as follows:

systemctl {start|stop|restart|status} celery.service celerybeat.service

To watch logs:

tail -f -n 10 ${P51_CELERY_DIR}/worker*

Download data

Download some historical data to work with by running the following script:

bash scripts/download_historical_data.bash

Download the detector checkpoint by running the following script:

bash scripts/download_model.bash

Backups

As a simple solution to creating backups manually, here are commands to backup both the database and the file storage:

# backup database
mysqldump -u ${P51_SQL_USERNAME} -p${P51_SQL_PASSWORD} ${P51_SQL_DATABASE_NAME} \
    > ${P51_SQL_DATABASE_NAME}_`date +'%Y-%m-%d'`.sql

# zip data
zip -r data_`date +'%Y-%m-%d'`.zip ${P51_DATA_DIR}

Acknowledgements

This project uses an EfficientDet model checkpoint that was graciously made available by the authors of the automl/efficientdet project.

Copyright

Copyright 2020, Voxel51, Inc.
voxel51.com

pandemic51's People

Contributors

benjaminpkane avatar brimoor avatar dependabot[bot] avatar ehofesmann avatar jasoncorso avatar lethosor avatar tylerganter avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pandemic51's Issues

Call to action buttons have unequal widths on mobile

The Contact us and Contribute buttons have unequal widths on mobile.

They should either be:
(a) both full width, like Contribute below
(b) both equal width, separate lines, and centered
(c) narrow and on the same line

I vote for (a).

IMG_F20C2B29CF2A-1

Show annotated image when releasing touch on mobile

On a desktop, an annotated image is shown on mouse-up on the graph.

On mobile, an annotated image is shown when I touch the graph. However, if I touch and drag, no annotated image is shown (neither on touch-down or touch-up).

Desired behavior: on mobile, show annotated image on touch-up.

Fix URL wrapping for longer snapshot links

For long city names, the snapshot URLs split onto two lines in a way that might be confusing to novice users

Easy fix is to increase width of box or otherwise ensure that reasonable city names will fit on one line. Or, decrease line spacing, add a link, etc., with the goal of making the URL look like one thing.

Screen Shot 2020-04-07 at 8 19 53 PM

Tweak text on data selection buttons

Can we change the button text to PDI only, Add cases, and Add deaths? This will clarify what each option does.

Also, can we only show the data source info when the relevant button is clicked?

When cases is clicked:

Number of cases are for all of New York County and are updated daily
Source: https://coronavirus.jhu.edu/map.html

When deaths is clicked:

Number of deaths are for all of New York County and are updated daily
Source: https://coronavirus.jhu.edu/map.html

Screen Shot 2020-04-07 at 8 21 16 PM

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.