Skip to content

Commit 2121830

Browse files
author
Corey Chivers
committed
Add difference in recovered to calc of new I
1 parent 7f7e33e commit 2121830

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

src/penn_chime/charts.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def admitted_patients_chart(
7474

7575
return (
7676
alt.Chart(census.head(plot_projection_days))
77-
.transform_fold(fold=["Hospitalized Census", "ICU Census", "Ventilated Census"])
77+
.transform_fold(fold=["Hospitalized", "ICU", "Ventilated"])
7878
.mark_line(point=True)
7979
.encode(
8080
x=alt.X(**x_kwargs),

src/penn_chime/models.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,10 @@ def sim_sir_df(p) -> pd.DataFrame:
7070

7171

7272
def get_dispositions(
73-
infected: np.ndarray, rates: Tuple[float, ...], market_share: float = 1.0
73+
patient_state: np.ndarray, rates: Tuple[float, ...], market_share: float = 1.0
7474
) -> Tuple[np.ndarray, ...]:
7575
"""Get dispositions of infected adjusted by rate and market_share."""
76-
return (*(infected * rate * market_share for rate in rates),)
77-
76+
return (*(patient_state * rate * market_share for rate in rates),)
7877

7978

8079
def build_admissions_df(p) -> pd.DataFrame:
@@ -117,7 +116,7 @@ def build_census_df(
117116
census_df = census_df[["day", "Hospitalized", "ICU", "Ventilated"]]
118117
census_df = census_df.head(n_days)
119118
census_df = census_df.rename(
120-
columns={disposition: f"{disposition} Census"
119+
columns={disposition: f"{disposition}"
121120
for disposition
122121
in ("Hospitalized", "ICU", "Ventilated")}
123122
)

src/penn_chime/parameters.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,13 @@ def n_days(self, n_days: int):
112112
)
113113
self.susceptible_v, self.infected_v, self.recovered_v = s_v, i_v, r_v
114114

115-
self.dispositions = hospitalized_v, icu_v, ventilated_v = \
115+
i_hospitalized_v, i_icu_v, i_ventilated_v = \
116116
get_dispositions(i_v, self.rates, self.market_share)
117+
r_hospitalized_v, r_icu_v, r_ventilated_v = \
118+
get_dispositions(r_v, self.rates, self.market_share)
119+
120+
self.dispositions = (i_hospitalized_v+r_hospitalized_v,
121+
i_icu_v+r_icu_v, i_ventilated_v+r_ventilated_v)
122+
117123
self.hospitalized_v, self.icu_v, self.ventilated_v = \
118-
hospitalized_v, icu_v, ventilated_v
124+
i_hospitalized_v, i_icu_v, i_ventilated_v

0 commit comments

Comments
 (0)