Skip to content

Commit 63ed99a

Browse files
authored
Fix census forecast
Compute census forecasts as far forward as admissions
2 parents e2d5f98 + e5a9b10 commit 63ed99a

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/penn_chime/charts.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def build_admits_chart(
4545
.transform_filter(alt.datum.day == 0)
4646
.mark_rule(color="black", opacity=0.35, size=2)
4747
)
48-
return alt.layer(points, bar, data=admits_df)
48+
return alt.layer(points, bar, data=ceil_df)
4949

5050

5151

src/penn_chime/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ def build_census_df(
312312
'date': admits_df.date,
313313
**{
314314
key: (
315-
admits_df[key].cumsum().iloc[:-los]
315+
admits_df[key].cumsum()
316316
- admits_df[key].cumsum().shift(los).fillna(0)
317317
).apply(np.ceil)
318318
for key, los in lengths_of_stay.items()

tests/test_app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ def test_admits_chart():
245245
admits_df = pd.read_csv("tests/by_doubling_time/2020-03-28_projected_admits.csv")
246246
chart = build_admits_chart(alt=alt, admits_df=admits_df)
247247
assert isinstance(chart, (alt.Chart, alt.LayerChart))
248-
assert round(chart.data.iloc[40].icu, 0) == 38
248+
assert round(chart.data.iloc[40].icu, 0) == 39
249249

250250
# test fx call with no params
251251
with pytest.raises(TypeError):

0 commit comments

Comments
 (0)