Skip to content

Commit 829c557

Browse files
Merge branch 'develop' into btr-pr-template
2 parents 9f62964 + e5a33a1 commit 829c557

File tree

10 files changed

+18
-144
lines changed

10 files changed

+18
-144
lines changed

defaults/cli.cfg

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
--current-hospitalized 69
2-
--doubling-time 4.0
2+
--doubling-time 5.0
33
--hospitalized-days 7
44
--hospitalized-rate 0.025
55
--icu-days 9
66
--icu-rate 0.0075
7-
--infectious-days 14
7+
--infectious-days 10
88
--market-share 0.15
99
--n-days 100
1010
--population 3600000
1111
--recovered 0
12-
--relative-contact-rate 0.3
12+
--relative-contact-rate 0.45
1313
--ventilated-days 10
1414
--ventilated-rate 0.005

defaults/webapp.cfg

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
--current-hospitalized 69
22
--date-first-hospitalized 2020-03-07
3-
--doubling-time 4.0
3+
--doubling-time 5.0
44
--hospitalized-days 7
55
--hospitalized-rate 0.025
66
--icu-days 9
77
--icu-rate 0.0075
8-
--infectious-days 14
8+
--infectious-days 10
99
--market-share 0.15
1010
--n-days 100
1111
--population 3600000
1212
--recovered 0
13-
--relative-contact-rate 0.3
13+
--relative-contact-rate 0.45
1414
--ventilated-days 10
1515
--ventilated-rate 0.005

docs/operations/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Operations guide to resources
22

3-
This guide will show you where nodes, and k8s clusters are stored and their heirarchy.
3+
This guide will show you where nodes, and k8s clusters are stored and their hierarchy.
44

55
## Production
66

@@ -13,4 +13,4 @@ Production k8s cluster is available on linode datacenter.
1313

1414
Pre Production k8s cluster is available on linode datacenter.
1515

16-
`chime-bus`
16+
`chime-bus`

docs/operations/prepare-new-chime-release.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,4 @@ At the end of following this process you will have deployed a new CHIME version
3737
the review of another DevOps admin whenever possible. Ensure to link
3838
to the PR in the deployment issue previously opened on GitHub.
3939

40-
6. One approved you will need to [create a release to auto deploy](release-process.md)
40+
6. Once approved, you will need to [create a release to auto deploy](release-process.md)

e2e/cypress/integration/tests/steppers.spec.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ context('Increment steppers', () => {
66
});
77

88
it('Increment regional population', () => {
9-
cy.contains('Hospitalized Admissions peaks at 300');
9+
cy.contains('Regional population (3600000)');
1010

1111
cy.get('input[type=number]').eq(0)
1212
.should('has.value', '3600000');
@@ -16,11 +16,11 @@ context('Increment steppers', () => {
1616
cy.get('input[type=number]').eq(0)
1717
.should('has.value', '3600001');
1818

19-
cy.contains('Hospitalized Admissions peaks at 300');
19+
cy.contains('Regional population (3600001)');
2020
});
2121

2222
it('Increment hospital market share', () => {
23-
cy.contains('Hospitalized Admissions peaks at 300');
23+
cy.contains('The estimated number of currently infected individuals is 20128.');
2424

2525
cy.get('input[type=number]').eq(1)
2626
.should('has.value', '15');
@@ -30,11 +30,11 @@ context('Increment steppers', () => {
3030
cy.get('input[type=number]').eq(1)
3131
.should('has.value', '15.1');
3232

33-
cy.contains('Hospitalized Admissions peaks at 302');
33+
cy.contains('The estimated number of currently infected individuals is 19996.');
3434
});
3535

3636
it('Increment doubling time', () => {
37-
cy.contains('Hospitalized Admissions peaks at 300');
37+
cy.contains('An initial doubling time of 4.0 days');
3838

3939
cy.get('input[type=number]').eq(3)
4040
.should('has.value', '4');
@@ -44,6 +44,6 @@ context('Increment steppers', () => {
4444
cy.get('input[type=number]').eq(3)
4545
.should('has.value', '4.25');
4646

47-
cy.contains('Hospitalized Admissions peaks at 272');
47+
cy.contains('An initial doubling time of 4.25 days');
4848
});
4949
});

src/app.py

Lines changed: 2 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@
1717
from penn_chime.charts import (
1818
build_admits_chart,
1919
build_census_chart,
20-
build_descriptions,
2120
build_sim_sir_w_date_chart,
22-
build_table,
2321
)
2422

2523
# This is somewhat dangerous:
@@ -35,49 +33,25 @@
3533
display_header(st, m, p)
3634

3735
st.subheader("New Admissions")
38-
st.markdown("Projected number of **daily** COVID-19 admissions. \n\n _NOTE: Now including estimates of prior admissions for comparison._")
36+
st.markdown("Projected number of **daily** COVID-19 admissions.")
3937
admits_chart = build_admits_chart(alt=alt, admits_floor_df=m.admits_floor_df, max_y_axis=p.max_y_axis)
4038
st.altair_chart(admits_chart, use_container_width=True)
41-
st.markdown(build_descriptions(chart=admits_chart, labels=p.labels, prefix="admits_", suffix=" Admissions"))
4239
display_download_link(
4340
st,
4441
filename=f"{p.current_date}_projected_admits.csv",
4542
df=m.admits_df,
4643
)
4744

48-
if st.checkbox("Show Projected Admissions in tabular form"):
49-
admits_modulo = 1
50-
if not st.checkbox("Show Daily Counts"):
51-
admits_modulo = 7
52-
table_df = build_table(
53-
df=m.admits_floor_df,
54-
labels=p.labels,
55-
modulo=admits_modulo)
56-
st.table(table_df)
57-
58-
5945
st.subheader("Admitted Patients (Census)")
60-
st.markdown("Projected **census** of COVID-19 patients, accounting for arrivals and discharges \n\n _NOTE: Now including estimates of prior census for comparison._")
46+
st.markdown("Projected **census** of COVID-19 patients, accounting for arrivals and discharges.")
6147
census_chart = build_census_chart(alt=alt, census_floor_df=m.census_floor_df, max_y_axis=p.max_y_axis)
6248
st.altair_chart(census_chart, use_container_width=True)
63-
st.markdown(build_descriptions(chart=census_chart, labels=p.labels, prefix="census_", suffix=" Census"))
6449
display_download_link(
6550
st,
6651
filename=f"{p.current_date}_projected_census.csv",
6752
df=m.census_df,
6853
)
6954

70-
if st.checkbox("Show Projected Census in tabular form"):
71-
census_modulo = 1
72-
if not st.checkbox("Show Daily Census Counts"):
73-
census_modulo = 7
74-
table_df = build_table(
75-
df=m.census_floor_df,
76-
labels=p.labels,
77-
modulo=census_modulo)
78-
st.table(table_df)
79-
80-
8155
st.subheader("Susceptible, Infected, and Recovered")
8256
st.markdown("The number of susceptible, infected, and recovered individuals in the hospital catchment region at any given moment")
8357
sim_sir_w_date_chart = build_sim_sir_w_date_chart(alt=alt, sim_sir_w_date_floor_df=m.sim_sir_w_date_floor_df)
@@ -88,10 +62,4 @@
8862
df=m.sim_sir_w_date_df,
8963
)
9064

91-
if st.checkbox("Show SIR Simulation in tabular form"):
92-
table_df = build_table(
93-
df=m.sim_sir_w_date_floor_df,
94-
labels=p.labels)
95-
st.table(table_df)
96-
9765
display_footer(st)

src/chime_dash/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ Install the chime base module
119119
```
120120
and run
121121
```bash
122-
> python src/dash_app.py
122+
> PARAMETERS=defaults/webapp.cfg python src/dash_app.py
123123
```
124124
in the project root and visit the local url.
125125

src/penn_chime/charts.py

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -127,51 +127,6 @@ def build_sim_sir_w_date_chart(
127127
)
128128

129129

130-
def build_descriptions(
131-
*,
132-
chart: Chart,
133-
labels: Dict[str, str],
134-
prefix: str = "",
135-
suffix: str = ""
136-
) -> str:
137-
"""
138-
139-
:param chart: The alt chart to be used in finding max points
140-
:param suffix: The assumption is that the charts have similar column names.
141-
The census chart adds " Census" to the column names.
142-
Make sure to include a space or underscore as appropriate
143-
:return: Returns a multi-line string description of the results
144-
"""
145-
messages = []
146-
147-
cols = ["hospitalized", "icu", "ventilated"]
148-
asterisk = False
149-
day = "date" if "date" in chart.data.columns else "day"
150-
151-
for col in cols:
152-
if chart.data[prefix+col].idxmax() + 1 == len(chart.data):
153-
asterisk = True
154-
155-
# todo: bring this to an optional arg / i18n
156-
on = datetime.strftime(chart.data[day][chart.data[prefix+col].idxmax()], "%b %d")
157-
158-
messages.append(
159-
"{}{} peaks at {:,} on {}{}".format(
160-
labels[col],
161-
suffix,
162-
ceil(chart.data[prefix+col].max()),
163-
on,
164-
"*" if asterisk else "",
165-
)
166-
)
167-
168-
if asterisk:
169-
messages.append(
170-
"_* The max is at the upper bound of the data, and therefore may not be the actual max_"
171-
)
172-
return "\n\n".join(messages)
173-
174-
175130
def build_table(
176131
*, df: pd.DataFrame, labels: Dict[str, str], modulo: int = 1
177132
) -> pd.DataFrame:

src/penn_chime/models.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -287,18 +287,6 @@ def sir(
287287
s_n = (-beta * s * i) + s
288288
i_n = (beta * s * i - gamma * i) + i
289289
r_n = gamma * i + r
290-
291-
# TODO:
292-
# Post check dfs for negative values and
293-
# warn the user that their input data is bad.
294-
# JL: I suspect that these adjustments covered bugs.
295-
296-
#if s_n < 0.0:
297-
# s_n = 0.0
298-
#if i_n < 0.0:
299-
# i_n = 0.0
300-
#if r_n < 0.0:
301-
# r_n = 0.0
302290
scale = n / (s_n + i_n + r_n)
303291
return s_n * scale, i_n * scale, r_n * scale
304292

tests/penn_chime/test_charts.py

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,11 @@
1-
from math import ceil
2-
from datetime import datetime
3-
41
import altair as alt
52
import pytest
63

74
from penn_chime.charts import (
85
build_admits_chart,
96
build_census_chart,
10-
build_descriptions,
117
)
128

13-
# TODO add test for asterisk
14-
15-
169
DISPOSITION_KEYS = ("hospitalized", "icu", "ventilated")
1710

1811

@@ -26,36 +19,6 @@ def test_admits_chart(admits_floor_df):
2619
build_admits_chart()
2720

2821

29-
def test_build_descriptions(admits_floor_df, param):
30-
chart = build_admits_chart(alt=alt, admits_floor_df=admits_floor_df)
31-
description = build_descriptions(chart=chart, labels=param.labels, prefix="admits_")
32-
33-
hosp, icu, vent = description.split("\n\n") # break out the description into lines
34-
35-
max_hosp = chart.data["admits_hospitalized"].max()
36-
assert str(ceil(max_hosp)) in hosp
37-
38-
39-
def test_no_asterisk(admits_floor_df, param):
40-
param.n_days = 600
41-
42-
chart = build_admits_chart(alt=alt, admits_floor_df=admits_floor_df)
43-
description = build_descriptions(chart=chart, labels=param.labels, prefix="admits_")
44-
assert "*" not in description
45-
46-
47-
def test_census(census_floor_df, param):
48-
chart = build_census_chart(alt=alt, census_floor_df=census_floor_df)
49-
description = build_descriptions(chart=chart, labels=param.labels, prefix="census_")
50-
51-
assert str(ceil(chart.data["census_ventilated"].max())) in description
52-
assert str(chart.data["census_icu"].idxmax()) not in description
53-
assert (
54-
datetime.strftime(chart.data.iloc[chart.data["census_icu"].idxmax()].date, "%b %d")
55-
in description
56-
)
57-
58-
5922
def test_census_chart(census_floor_df):
6023
chart = build_census_chart(alt=alt, census_floor_df=census_floor_df)
6124
assert isinstance(chart, (alt.Chart, alt.LayerChart))

0 commit comments

Comments
 (0)