Skip to content

Commit 122699e

Browse files
Modify links to PPE tool
1 parent 31cac9b commit 122699e

File tree

9 files changed

+14
-15
lines changed

9 files changed

+14
-15
lines changed

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
FROM python:3.7.7-slim-buster
22
ENV PARAMETERS=./defaults/webapp.cfg
3-
ENV PPE_EXCEL=./defaults/PPE_Usage_Draft_CC_modifications_v2.xlsx
3+
ENV PPE_FOLDER=./defaults/assets/
44
ENV STREAMLIT_SERVER_PORT=$PORT
55
WORKDIR /app
66
COPY README.md .
@@ -13,5 +13,5 @@ COPY src src
1313
COPY st_app.py st_app.py
1414
RUN pip install -q .
1515

16-
CMD ["streamlit", "run", "st_app.py"]
16+
CMD STREAMLIT_SERVER_PORT=$PORT streamlit run st_app.py
1717

Binary file not shown.

defaults/assets/PPE_Screenshot.jpg

253 KB
Loading
1.2 MB
Loading
1.01 MB
Loading

heroku.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,4 @@ build:
22
docker:
33
web: Dockerfile
44
config:
5-
PORT: ${PORT}
6-
run:
7-
web: PARAMETERS=./defaults/webapp.cfg PPE_EXCEL=./defaults/PPE_Usage_Draft_CC_modifications_v2.xlsx streamlit run st_app.py
5+
PORT: ${PORT}

src/penn_chime/locales/en.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ en:
33
app-new-admissions-text: "Projected number of **daily** COVID-19 admissions."
44
app-admitted-patients-title: "Admitted Patients (Census)"
55
app-admitted-patients-text: "Projected **census** of COVID-19 patients, accounting for arrivals and discharges."
6-
app-PPE-title: "PPE Forecasting Tool"
6+
app-PPE-title: "Personal Protective Equipment (PPE) Calculator"
77
app-SIR-title: "Susceptible, Infected, and Recovered"
88
app-SIR-text: "The number of susceptible, infected, and recovered individuals in the hospital catchment region at any given moment"
99
charts-date: "Date"

src/penn_chime/ppe/ppe.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,19 @@
2929

3030
class PPE:
3131

32-
excel_file = None
32+
ppe_folder = None
3333

3434
@classmethod
3535
def __init__(cls, env: Dict[str, str]):
36-
cls.excel_file = env.get("PPE_EXCEL")
36+
cls.ppe_folder = env.get("PPE_FOLDER")
3737
return
3838

3939
@classmethod
4040
def display_ppe_download_link(cls, st):
41-
excel = excel_to_base64(cls.excel_file)
42-
filename = cls.excel_file[cls.excel_file.rfind('/')+1:]
41+
excel_filepath = cls.ppe_folder+'PPE_Calculator_for_COVID-19.xlsx'
42+
filename = excel_filepath[excel_filepath.rfind('/')+1:]
43+
excel = excel_to_base64(excel_filepath)
4344
st.markdown("""
44-
Download the PPE forecasting tool here: <a download="{filename}" href="data:file/xlsx;base64,{excel}">{filename}</a>.
45+
Download the PPE Calculator here: <a download="{filename}" href="data:file/xlsx;base64,{excel}">{filename}</a>.
4546
""".format(excel=excel, filename=filename), unsafe_allow_html=True
4647
)

src/penn_chime/view/st_app.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,12 @@ def main():
7272
df=m.ppe_df,
7373
)
7474
if st.checkbox("Show a screenshot of the tool"):
75-
st.image(image='https://docs.google.com/uc?export=download&id=1K6y3mdo5vHxs2WlnaD-EVykXgrIOFfPk',
76-
width=400,
77-
format='PNG')
75+
st.image(image=ppe.ppe_folder+'PPE_Screenshot.jpg',
76+
width=600,
77+
format='JPG')
7878
st.markdown("""
7979
Refer to our <a href="{link_to_docs}">user documentation for instructions on how to use the tool</a>.
80-
""".format(link_to_docs="https://code-for-philly.gitbook.io/chime/"),
80+
""".format(link_to_docs="https://code-for-philly.gitbook.io/chime/ppe-calculator"),
8181
unsafe_allow_html=True
8282
)
8383

0 commit comments

Comments
 (0)