Skip to content

Commit cda7317

Browse files
authored
Merge branch 'develop' into unit_test_dash_utils
2 parents 2e4adbf + 4ba3bed commit cda7317

38 files changed

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

Dockerfile

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
11
FROM python:3.7.7-slim-buster
2-
RUN mkdir /app
2+
ENV PARAMETERS=./defaults/webapp.cfg
33
WORKDIR /app
44
COPY README.md .
55
COPY setup.cfg .
66
COPY setup.py .
7-
COPY requirements.txt .
8-
# Creating an empty src dir is a (hopefully) temporary hack to improve layer caching and speed up image builds
9-
# todo fix once the Pipfile, setup.py, requirements.txt, pyprojec.toml build/dist story is figured out
10-
RUN mkdir src && pip install -q .
117
COPY .streamlit .streamlit
12-
COPY settings.cfg .
8+
COPY defaults defaults
139
COPY src src
10+
RUN pip install -q .
1411

1512
CMD ["streamlit", "run", "src/app.py"]
1613

Dockerfile.dash

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,14 @@ WORKDIR /code
44

55
ARG PORT
66
ENV PORT $PORT
7+
ENV PARAMETERS=./defaults/webapp.cfg
78

8-
COPY requirements.txt requirements.txt
9-
RUN pip install -r requirements.txt
10-
9+
COPY README.md .
10+
COPY setup.py .
11+
COPY setup.cfg .
1112
COPY src src
13+
COPY defaults ./src/defaults
14+
RUN pip install -q .
1215

1316
# EXPOSE $PORT
1417

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
1-
--current-hospitalized 14
1+
--current-hospitalized 69
22
--doubling-time 4.0
33
--hospitalized-days 7
44
--hospitalized-rate 0.025
55
--icu-days 9
66
--icu-rate 0.0075
77
--infectious-days 14
8-
--market_share 0.15
9-
--n-days 60
10-
--population 4119405
8+
--market-share 0.15
9+
--n-days 100
10+
--population 3600000
11+
--recovered 0
1112
--relative-contact-rate 0.3
1213
--ventilated-days 10
1314
--ventilated-rate 0.005

defaults/cypress.cfg

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
--current-hospitalized 69
2+
--date-first-hospitalized 2020-03-07
3+
--doubling-time 4.0
4+
--hospitalized-days 7
5+
--hospitalized-rate 0.025
6+
--icu-days 9
7+
--icu-rate 0.0075
8+
--infectious-days 14
9+
--market-share 0.15
10+
--n-days 100
11+
--population 3600000
12+
--recovered 0
13+
--relative-contact-rate 0.3
14+
--ventilated-days 10
15+
--ventilated-rate 0.005

defaults/readme.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Webapps need default values for both date_first_hosptalized and doubling_time. The ui overrides one of them.
2+
3+
CLI needs either date_first_hospitalized xor doubling_time.

defaults/webapp.cfg

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
--current-hospitalized 69
2+
--date-first-hospitalized 2020-03-07
3+
--doubling-time 4.0
4+
--hospitalized-days 7
5+
--hospitalized-rate 0.025
6+
--icu-days 9
7+
--icu-rate 0.0075
8+
--infectious-days 14
9+
--market-share 0.15
10+
--n-days 100
11+
--population 3600000
12+
--recovered 0
13+
--relative-contact-rate 0.3
14+
--ventilated-days 10
15+
--ventilated-rate 0.005

docs/CONTRIBUTING.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,12 @@ As of March 21, help is especially wanted from contributors with experience in K
2626

2727
- [Fork](https://help.github.com/en/github/getting-started-with-github/fork-a-repo) the [CodeforPhilly/chime](https://github.com/CodeForPhilly/chime) repo.
2828
- Base your work on the `develop` branch.
29+
- Take a few minutes to review this [resource](https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Reviewer_Checklist) for contributors and reviewers, to accelerate the adoption of your contribution (thanks to the good folks at Mozilla for this).
2930
- Submit pull requests from your fork, also against the `develop` branch of the `CodeforPhilly/chime` repo.
3031
- Request review from the relevant maintainer(s).
3132
- Check your pull request periodically to see if any changes have been requested or any merge conflicts have arisen.
3233
- If a merge conflict arises, rebase against the latest `develop` branch and force-push the new branch as early as you can. You may need to do this more than once before your changes get merged. Do your best to keep your branch in a mergeable state until it is finished being reviewed and accepted.
33-
- If your change affects the results calculated or presented, update `change_date` in `src/penn_chime/parameters.py` when the pull request is ready for merge, so users can see when results have last changed
34+
- If your change affects the results calculated or presented, update `change_date` in `src/penn_chime/constants.py` when the pull request is ready for merge, so users can see when results have last changed
3435
- Note: Frequent contributors with write access can submit pull requests from a new branch in the `CodeforPhilly/chime` repository.
3536

3637
## Review & Release

k8s/app.yaml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,52 @@ spec:
2727
containers:
2828
- image: docker.pkg.github.com/codeforphilly/chime/penn-chime:1.1.2
2929
name: chime
30+
env:
31+
- name: GAPI_CRED_TYPE
32+
valueFrom:
33+
secretKeyRef:
34+
name: google-api-creds
35+
key: type
36+
- name: GAPI_CRED_PROJECT_ID
37+
valueFrom:
38+
secretKeyRef:
39+
name: google-api-creds
40+
key: project_id
41+
- name: GAPI_CRED_PRIVATE_KEY_ID
42+
valueFrom:
43+
secretKeyRef:
44+
name: google-api-creds
45+
key: private_key_id
46+
- name: GAPI_CRED_PRIVATE_KEY
47+
valueFrom:
48+
secretKeyRef:
49+
name: google-api-creds
50+
key: private_key
51+
- name: GAPI_CRED_CLIENT_EMAIL
52+
valueFrom:
53+
secretKeyRef:
54+
name: google-api-creds
55+
key: client_email
56+
- name: GAPI_CRED_CLIENT_ID
57+
valueFrom:
58+
secretKeyRef:
59+
name: google-api-creds
60+
key: client_id
61+
- name: GAPI_CRED_AUTH_PROVIDER_X509_CERT_URL
62+
valueFrom:
63+
secretKeyRef:
64+
name: google-api-creds
65+
key: auth_provider_x509_cert_url
66+
- name: GAPI_CRED_CLIENT_X509_CERT_URL
67+
valueFrom:
68+
secretKeyRef:
69+
name: google-api-creds
70+
key: client_x509_cert_url
3071
ports:
3172
- containerPort: 8000
3273
name: http
3374
protocol: TCP
75+
3476
imagePullSecrets:
3577
- name: regcred
3678

setup.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
"""Setup file for chime
22
"""
3-
__version__ = "1.1.2" # update VERSION in constants.py
3+
__version__ = "1.1.3" # update VERSION in constants.py
44
__author__ = "Predictive Healthcare @ Penn Medicine"
55

6-
from os import path
7-
from setuptools import setup, find_packages, find_namespace_packages
6+
from setuptools import setup, find_namespace_packages
87

98

109
setup(
@@ -24,6 +23,7 @@
2423
install_requires=[
2524
"altair",
2625
"black",
26+
"gspread",
2727
"gunicorn",
2828
"dash",
2929
"dash_bootstrap_components",
@@ -33,17 +33,18 @@
3333
"pyyaml",
3434
"selenium",
3535
"streamlit",
36+
"gspread",
37+
"oauth2client"
3638
],
3739
classifiers=[
3840
"Programming Language :: Python :: 3",
3941
"License :: OSI Approved :: MIT License",
4042
"Operating System :: OS Independent",
4143
],
4244
python_requires='>=3.7',
43-
entry_points = {
45+
entry_points={
4446
'console_scripts': ['penn_chime=penn_chime.cli:main'],
4547
},
4648
keywords=[],
4749
include_package_data=True,
4850
)
49-

0 commit comments

Comments
 (0)