Skip to content

Commit 62bb75a

Browse files
committed
Update dev docs
1 parent 2e21e01 commit 62bb75a

File tree

2 files changed

+25
-11
lines changed

2 files changed

+25
-11
lines changed

docs/contributing/app-dev.md

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ See [Streamlit's Getting Started guide](https://docs.streamlit.io/getting_starte
2424
```bash
2525
pipenv shell
2626
pipenv sync --dev
27-
streamlit run src/app.py
27+
PARAMETERS=./defaults/webapp.cfg streamlit run st_app.py
2828
```
2929

3030
### With `conda`
@@ -33,33 +33,43 @@ streamlit run src/app.py
3333
conda env create -f environment.yml
3434
source activate chime
3535
pip install streamlit
36-
streamlit run src/app.py
36+
PARAMETERS=./defaults/webapp.cfg streamlit run st_app.py
3737
```
3838

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+
3950
### Choosing a Different Port
4051

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.
4253

4354
```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
4656
```
4757

4858
## Project Layout
4959

5060
### Application files
5161

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.
5465
- `script/`: Developer workflow scripts following [GitHub's Scripts To Rule Them All](https://github.com/github/scripts-to-rule-them-all) pattern.
5566
- `.streamlit/`: [Streamlit config options](https://docs.streamlit.io/cli.html)
5667
- `.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`
5869
- `Pipfile`
5970
- `Pipfile.lock`
60-
- `environment.yml`
61-
- `requirements.txt`
6271
- `setup.py`
72+
- `setup.cfg`: Configuration for flake8, mypy, [pytest](https://docs.pytest.org/en/latest/)
6373

6474
### Documentation
6575

@@ -86,6 +96,10 @@ pip install pytest
8696
pytest
8797
```
8898

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+
89103
## Validating CHIME
90104

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

src/penn_chime/view/st_app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
build_census_chart,
1313
build_sim_sir_w_date_chart,
1414
)
15-
from .display import (
15+
from .st_display import (
1616
display_download_link,
1717
display_footer,
1818
display_header,

0 commit comments

Comments
 (0)