Skip to content

Commit 03691bd

Browse files
committed
Fix test
1 parent 5bed704 commit 03691bd

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

tests/test_app.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -301,11 +301,19 @@ def test_model_raw_end(model=MODEL, param=PARAM):
301301

302302

303303
def test_model_cumulative_census(model=MODEL):
304-
# test that admissions are being properly calculated
304+
# test that census is being properly calculated
305305
raw_df = model.raw_df
306-
cumulative_admits = model.admits_df.cumsum()
307-
diff = cumulative_admits.hospitalized[1:-1] - (
308-
0.05 * 0.05 * (raw_df.infected[1:-1] + raw_df.recovered[1:-1]) - 100
306+
admits_df = model.admits_df
307+
df = pd.DataFrame({
308+
"hospitalized": admits_df.hospitalized,
309+
"icu": admits_df.icu,
310+
"ventilated": admits_df.ventilated
311+
})
312+
admits = df.cumsum()
313+
314+
# TODO: is 1.0 for ceil function?
315+
diff = admits.hospitalized[1:-1] - (
316+
0.05 * 0.05 * (raw_df.infected[1:-1] + raw_df.recovered[1:-1]) - 1.0
309317
)
310318
assert (diff.abs() < 0.1).all()
311319

0 commit comments

Comments
 (0)