You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/contributing/app-dev.md
+24-10Lines changed: 24 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,7 +24,7 @@ See [Streamlit's Getting Started guide](https://docs.streamlit.io/getting_starte
24
24
```bash
25
25
pipenv shell
26
26
pipenv sync --dev
27
-
streamlit run src/app.py
27
+
PARAMETERS=./defaults/webapp.cfg streamlit run st_app.py
28
28
```
29
29
30
30
### With `conda`
@@ -33,33 +33,43 @@ streamlit run src/app.py
33
33
conda env create -f environment.yml
34
34
source activate chime
35
35
pip install streamlit
36
-
streamlit run src/app.py
36
+
PARAMETERS=./defaults/webapp.cfg streamlit run st_app.py
37
37
```
38
38
39
+
### Choosing a Different Set of Parameters
40
+
41
+
If you want a different set of default parameters, you may use your own configuration file.
42
+
43
+
```bash
44
+
PARAMETERS=./defaults/yours.cfg streamlit run st_app.py
45
+
```
46
+
47
+
Be sure to include `--current-date` in the file, if your `--current-hospitalized` is not today's value.
48
+
Be sure to include `--mitigation-date` in the file if social distancing was implemented before today.
49
+
39
50
### Choosing a Different Port
40
51
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:
52
+
If you need to run the application on a different port than the default (8000), you can set an environment variable.
42
53
43
54
```bash
44
-
export STREAMLIT_SERVER_PORT=1234
45
-
streamlit run src/app.py
55
+
STREAMLIT_SERVER_PORT=1234 PARAMETERS=./defaults/webapp.cfg streamlit run st_app.py
46
56
```
47
57
48
58
## Project Layout
49
59
50
60
### Application files
51
61
52
-
-`src/app.py`: Main source for the application
53
-
-`src/test_app.py`: [pytest](https://docs.pytest.org/en/latest/) tests for `app.py`
62
+
-`st_app.py`: Startup script for the streamlit web application.
63
+
-`src`: Source code for the `penn_chime` module.
64
+
-`tests/`: [pytest](https://docs.pytest.org/en/latest/) tests for the `penn_chime` module.
54
65
-`script/`: Developer workflow scripts following [GitHub's Scripts To Rule Them All](https://github.com/github/scripts-to-rule-them-all) pattern.
-`.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
57
-
-`pytest.ini`: Configuration for [pytest](https://docs.pytest.org/en/latest/)
68
+
-`environment.yml`
58
69
-`Pipfile`
59
70
-`Pipfile.lock`
60
-
-`environment.yml`
61
-
-`requirements.txt`
62
71
-`setup.py`
72
+
-`setup.cfg`: Configuration for flake8, mypy, [pytest](https://docs.pytest.org/en/latest/)
63
73
64
74
### Documentation
65
75
@@ -86,6 +96,10 @@ pip install pytest
86
96
pytest
87
97
```
88
98
99
+
The test code runs from the local `tests` directory. Updating code in `tests` modifies the tests.
100
+
However, the tested code is the *installed* penn_chime module in your virtual environment's site-packages directory, it is *not* the code in the local `src` directory.
101
+
Use `pip install .` to push your local changes in `src` to replace the installed `penn_chime` module.
102
+
89
103
## Validating CHIME
90
104
91
105
*No validation routine is available yet. If you have thoughts on how to add one, please contribute!*
0 commit comments