Skip to content

Commit 94eb9ce

Browse files
Merge pull request #573 from CodeForPhilly/ppe
- Adds Personal Protective Equipment (PPE) Model with downloadable tool
2 parents bc8f45b + d1333db commit 94eb9ce

File tree

16 files changed

+101
-10
lines changed

16 files changed

+101
-10
lines changed

.github/workflows/pythonapp.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
python -m pytest
4444
- name: Run App
4545
run: |
46-
PARAMETERS=./defaults/cypress.cfg streamlit run st_app.py &
46+
PARAMETERS=./defaults/cypress.cfg ASSETS=./defaults/assets streamlit run st_app.py &
4747
- name: Cypress
4848
uses: cypress-io/github-action@v1
4949
with:

Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
FROM python:3.7.7-slim-buster
2+
ENV ASSETS=./defaults/assets/
23
ENV PARAMETERS=./defaults/webapp.cfg
34
ENV PORT=8000
45
WORKDIR /app
@@ -11,4 +12,5 @@ COPY defaults defaults
1112
COPY src src
1213
COPY st_app.py st_app.py
1314
RUN pip install -q .
15+
1416
CMD STREAMLIT_SERVER_PORT=$PORT streamlit run st_app.py

Procfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
web: PARAMETERS=defaults/webapp.cfg STREAMLIT_SERVER_PORT=$PORT streamlit run st_app.py
1+
web: PARAMETERS=./defaults/webapp.cfg ASSETS=./defaults/assets STREAMLIT_SERVER_PORT=$PORT streamlit run st_app.py
Binary file not shown.

defaults/assets/PPE_Screenshot.jpg

253 KB
Loading
1.2 MB
Loading
1.01 MB
Loading

docs/contributing/app-dev.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,14 @@ pip install streamlit
4646
## Run the Streamlit Web App
4747

4848
```bash
49+
ASSETS=./defaults/assets \
4950
PARAMETERS=-./defaults/webapp.cfg streamlit run st_app.py
5051
```
5152

5253
## Run the Command Line Interface
5354

5455
```bash
56+
ASSETS=./defaults/assets \
5557
PARAMETERS=./defaults/cli.cfg penn_chime
5658
```
5759

@@ -66,6 +68,7 @@ penn_chime --help
6668
If you want a different set of default parameters, you may use your own configuration file.
6769

6870
```bash
71+
ASSETS=./defaults/assets \
6972
PARAMETERS=./defaults/yours.cfg streamlit run st_app.py
7073
```
7174

@@ -77,7 +80,9 @@ Be sure to include `--mitigation-date` in the file if social distancing was impl
7780
If you need to run the application on a different port than the default (8000), you can set an environment variable.
7881

7982
```bash
80-
STREAMLIT_SERVER_PORT=1234 PARAMETERS=./defaults/webapp.cfg streamlit run st_app.py
83+
ASSETS=./defaults/assets \
84+
STREAMLIT_SERVER_PORT=1234 \
85+
PARAMETERS=./defaults/webapp.cfg streamlit run st_app.py
8186
```
8287

8388
## Project Layout

heroku.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ build:
22
docker:
33
web: Dockerfile
44
config:
5-
PORT: ${PORT}
5+
PORT: ${PORT}

src/penn_chime/cli.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,21 @@
66
from .model.parameters import Parameters
77
from .model.sir import Sir
88

9+
910
def run(argv):
11+
"""Eun cli."""
1012
p = Parameters.create(os.environ, argv[1:])
1113
m = Sir(p)
1214

1315
for df, name in (
1416
(m.sim_sir_w_date_df, "sim_sir_w_date"),
1517
(m.admits_df, "projected_admits"),
1618
(m.census_df, "projected_census"),
19+
(m.ppe_df, 'ppe_data')
1720
):
1821
df.to_csv(f"{p.current_date}_{name}.csv")
1922

23+
2024
def main():
2125
"""Main."""
2226
run(sys.argv)

0 commit comments

Comments
 (0)