Skip to content

Commit f6b35de

Browse files
committed
Merge remote-tracking branch 'upstream/develop' into develop
2 parents d065481 + 327101b commit f6b35de

34 files changed

+285
-148
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* text=auto

.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 src/app.py &
46+
PARAMETERS=./defaults/cypress.cfg streamlit run st_app.py &
4747
- name: Cypress
4848
uses: cypress-io/github-action@v1
4949
with:

Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ COPY setup.py .
77
COPY .streamlit .streamlit
88
COPY defaults defaults
99
COPY src src
10+
COPY st_app.py st_app.py
1011
RUN pip install -q .
1112

12-
CMD ["streamlit", "run", "src/app.py"]
13+
CMD ["streamlit", "run", "st_app.py"]
1314

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 src/app.py
1+
web: PARAMETERS=defaults/webapp.cfg STREAMLIT_SERVER_PORT=$PORT streamlit run st_app.py
Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
1+
--current-date 2020-04-28
12
--current-hospitalized 14
23
--date-first-hospitalized 2020-03-07
3-
--hospitalized-los 7
4+
--hospitalized-days 7
45
--hospitalized-rate 0.025
5-
--icu-los 9
6+
--icu-days 9
67
--icu-rate 0.0075
78
--infectious-days 14
8-
--known-infected 510
9-
--market_share 0.15
9+
--mitigation-date 2020-04-28
10+
--market-share 0.15
1011
--n-days 60
1112
--population 4119405
13+
--recovered 0
1214
--relative-contact-rate 0.3
13-
--ventilated-los 10
15+
--ventilated-days 10
1416
--ventilated-rate 0.005
Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
1+
--current-date 2020-04-28
12
--current-hospitalized 14
23
--doubling-time 4.0
3-
--hospitalized-los 7
4+
--hospitalized-days 7
45
--hospitalized-rate 0.025
5-
--icu-los 9
6+
--icu-days 9
67
--icu-rate 0.0075
78
--infectious-days 14
8-
--known-infected 510
9-
--market_share 0.15
9+
--market-share 0.15
10+
--mitigation-date 2020-04-28
1011
--n-days 60
1112
--population 4119405
13+
--recovered 0
1214
--relative-contact-rate 0.3
13-
--ventilated-los 10
15+
--ventilated-days 10
1416
--ventilated-rate 0.005

docs/SUMMARY.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
- [Data Analysis](contributing/data-analysis.md)
1010
- [Operations Support](contributing/operations-support.md)
1111
- Operations
12-
- [Preparing a new release](./operations/prepare-new-chime-release.md)
13-
- [Release Process](./operations/release=process.md)
12+
- [Release Process](./operations/release-process.md)
13+
- [Release Automation](./operations/release-automation.md)
1414
- [The `chime-live` Cluster](./operations/chime-live-cluster.md)
1515
- [Deploy to Heroku](./operations/heroku.md)
1616
- [Deploy with Chef Habitat](./operations/habitat.md)

docs/contributing/app-dev.md

Lines changed: 51 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,27 @@
1212

1313
The application is built with [Streamlit](https://www.streamlit.io/), Streamlit requires:
1414

15-
- Python 2.7.0 or later / Python 3.6.x or later
15+
- Python 3.6.x or later
1616
- PIP
1717

1818
See [Streamlit's Getting Started guide](https://docs.streamlit.io/getting_started.html) for detailed information on prerequisites and setup
1919

2020
## Running CHIME Locally
2121

22+
23+
### With `venv`
24+
25+
```bash
26+
python3 -m venv ~.venv
27+
. ~.venv/bin/activate
28+
pip install -e .
29+
```
30+
2231
### With `pipenv`
2332

2433
```bash
2534
pipenv shell
2635
pipenv sync --dev
27-
PARAMETERS=defaults/webapp.cfg streamlit run src/app.py
2836
```
2937

3038
### With `conda`
@@ -33,32 +41,60 @@ PARAMETERS=defaults/webapp.cfg streamlit run src/app.py
3341
conda env create -f environment.yml
3442
source activate chime
3543
pip install streamlit
36-
PARAMETERS=defaults/webapp.cfg streamlit run src/app.py
3744
```
3845

46+
## Run the Streamlit Web App
47+
48+
```bash
49+
PARAMETERS=-./defaults/webapp.cfg streamlit run st_app.py
50+
```
51+
52+
## Run the Command Line Interface
53+
54+
```bash
55+
PARAMETERS=./defaults/cli.cfg penn_chime
56+
```
57+
58+
## Help with the Command Line Interface
59+
60+
```bash
61+
penn_chime --help
62+
```
63+
64+
### Choosing a Different Set of Parameters
65+
66+
If you want a different set of default parameters, you may use your own configuration file.
67+
68+
```bash
69+
PARAMETERS=./defaults/yours.cfg streamlit run st_app.py
70+
```
71+
72+
Be sure to include `--current-date` in the file, if your `--current-hospitalized` is not today's value.
73+
Be sure to include `--mitigation-date` in the file if social distancing was implemented before today.
74+
3975
### Choosing a Different Port
4076

41-
If you need to run the application on a different port than the default (8000), you can export a variable in your shell session to override it with any port number of your choice before running:
77+
If you need to run the application on a different port than the default (8000), you can set an environment variable.
4278

4379
```bash
44-
STREAMLIT_SERVER_PORT=1234 PARAMETERS=defaults/webapp.cfg streamlit run src/app.py
80+
STREAMLIT_SERVER_PORT=1234 PARAMETERS=./defaults/webapp.cfg streamlit run st_app.py
4581
```
4682

4783
## Project Layout
4884

4985
### Application files
5086

51-
- `src/app.py`: Main source for the application
52-
- `src/test_app.py`: [pytest](https://docs.pytest.org/en/latest/) tests for `app.py`
87+
- `st_app.py`: Startup script for the streamlit web application.
88+
- `src`: Source code for the `penn_chime` module.
89+
- `tests/`: [pytest](https://docs.pytest.org/en/latest/) tests for the `penn_chime` module.
5390
- `script/`: Developer workflow scripts following [GitHub's Scripts To Rule Them All](https://github.com/github/scripts-to-rule-them-all) pattern.
5491
- `.streamlit/`: [Streamlit config options](https://docs.streamlit.io/cli.html)
5592
- `.env`: Local environment variables to use when running application, this file is copied from `.env.example` to start you out and then ignored by git
56-
- `pytest.ini`: Configuration for [pytest](https://docs.pytest.org/en/latest/)
93+
- `environment.yml`
5794
- `Pipfile`
5895
- `Pipfile.lock`
59-
- `environment.yml`
60-
- `requirements.txt`
6196
- `setup.py`
97+
- `setup.cfg`: Configuration for flake8, mypy, [pytest](https://docs.pytest.org/en/latest/)
6298

6399
### Documentation
64100

@@ -85,6 +121,11 @@ pip install pytest
85121
pytest
86122
```
87123

124+
The test code runs from the local `tests` directory. Updating code in `tests` modifies the tests.
125+
Use `pip install -e .` so that your local changes to `src` are also the module under test.
126+
For CI, use `pip install .` to test the module installed in site-packages to ensure that the installed module is packaged correctly with all of its dependencies.
127+
Do not import from src in your tests or your python code as this will appear to work locally, but break the python module.
128+
88129
## Validating CHIME
89130

90131
*No validation routine is available yet. If you have thoughts on how to add one, please contribute!*

setup.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
"pandas",
3232
"pytest",
3333
"pyyaml",
34-
"selenium",
3534
"streamlit",
3635
"gspread",
3736
"oauth2client"

src/app.py

Lines changed: 0 additions & 65 deletions
This file was deleted.

0 commit comments

Comments
 (0)