Skip to content

Commit 54596d5

Browse files
committed
add param for day range in tables, remove daily_count param
1 parent 9c3bd43 commit 54596d5

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

src/penn_chime/presentation.py

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -381,12 +381,9 @@ def show_additional_projections(
381381

382382

383383
def draw_projected_admissions_table(
384-
st, projection_admits: pd.DataFrame, labels, as_date: bool = False, daily_count: bool = False,
384+
st, projection_admits: pd.DataFrame, labels, day_range, as_date: bool = False
385385
):
386-
if daily_count == True:
387-
admits_table = projection_admits[np.mod(projection_admits.index, 1) == 0].copy()
388-
else:
389-
admits_table = projection_admits[np.mod(projection_admits.index, 7) == 0].copy()
386+
admits_table = projection_admits[np.mod(projection_admits.index, day_range) == 0].copy()
390387
admits_table["day"] = admits_table.index
391388
admits_table.index = range(admits_table.shape[0])
392389
admits_table = admits_table.fillna(0).astype(int)
@@ -400,11 +397,8 @@ def draw_projected_admissions_table(
400397
return None
401398

402399

403-
def draw_census_table(st, census_df: pd.DataFrame, labels, as_date: bool = False, daily_count: bool = False):
404-
if daily_count == True:
405-
census_table = census_df[np.mod(census_df.index, 1) == 0].copy()
406-
else:
407-
census_table = census_df[np.mod(census_df.index, 7) == 0].copy()
400+
def draw_census_table(st, census_df: pd.DataFrame, labels, day_range, as_date: bool = False):
401+
census_table = census_df[np.mod(census_df.index, day_range) == 0].copy()
408402
census_table.index = range(census_table.shape[0])
409403
census_table.loc[0, :] = 0
410404
census_table = census_table.dropna().astype(int)

0 commit comments

Comments
 (0)