Skip to content

Commit e706e83

Browse files
fixing lint
1 parent 44bc837 commit e706e83

File tree

2 files changed

+1
-47
lines changed

2 files changed

+1
-47
lines changed

src/penn_chime/presentation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ def show_more_info_about_this_tool(
281281
$\\gamma$ is the inverse of the mean recovery time, in days. I.e.: if $\\gamma = 1/{recovery_days}$, then the average infection will clear in {recovery_days} days.
282282
283283
An important descriptive parameter is the _basic reproduction number_, or $R_0$. This represents the average number of people who will be infected by any given infected person. When $R_0$ is greater than 1, it means that a disease will grow. Higher $R_0$'s imply more rapid growth. It is defined as """.format(
284-
recovery_days=int(recovery_days)
284+
recovery_days=int(parameters.recovery_days)
285285
)
286286
)
287287
st.latex("R_0 = \\beta /\\gamma")

src/penn_chime/utils.py

Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -15,52 +15,6 @@
1515
RateLos = namedtuple('RateLos', ('rate', 'length_of_stay'))
1616

1717

18-
def build_admissions_df(p) -> pd.DataFrame:
19-
"""Build admissions dataframe from Parameters."""
20-
days = np.array(range(0, p.n_days + 1))
21-
data_dict = dict(zip(["day", "Hospitalized", "ICU", "Ventilated"],
22-
[days] + [disposition for disposition in p.dispositions]
23-
))
24-
projection = pd.DataFrame.from_dict(data_dict)
25-
# New cases
26-
projection_admits = projection.iloc[:-1, :] - projection.shift(1)
27-
projection_admits[projection_admits < 0] = 0
28-
projection_admits["day"] = range(projection_admits.shape[0])
29-
return projection_admits
30-
31-
32-
def build_census_df(
33-
projection_admits: pd.DataFrame,
34-
parameters
35-
) -> pd.DataFrame:
36-
"""ALOS for each category of COVID-19 case (total guesses)"""
37-
n_days = np.shape(projection_admits)[0]
38-
hosp_los, icu_los, vent_los = parameters.lengths_of_stay
39-
los_dict = {
40-
"Hospitalized": hosp_los,
41-
"ICU": icu_los,
42-
"Ventilated": vent_los,
43-
}
44-
45-
census_dict = dict()
46-
for k, los in los_dict.items():
47-
census = (
48-
projection_admits.cumsum().iloc[:-los, :]
49-
- projection_admits.cumsum().shift(los).fillna(0)
50-
).apply(np.ceil)
51-
census_dict[k] = census[k]
52-
53-
census_df = pd.DataFrame(census_dict)
54-
census_df["day"] = census_df.index
55-
census_df = census_df[["day", "Hospitalized", "ICU", "Ventilated"]]
56-
census_df = census_df.head(n_days)
57-
census_df = census_df.rename(
58-
columns={disposition: f"{disposition} Census"
59-
for disposition
60-
in ("Hospitalized", "ICU", "Ventilated")}
61-
)
62-
return census_df
63-
6418

6519
def add_date_column(
6620
df: pd.DataFrame,

0 commit comments

Comments
 (0)