File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -301,11 +301,19 @@ def test_model_raw_end(model=MODEL, param=PARAM):
301
301
302
302
303
303
def test_model_cumulative_census (model = MODEL ):
304
- # test that admissions are being properly calculated
304
+ # test that census is being properly calculated
305
305
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
309
317
)
310
318
assert (diff .abs () < 0.1 ).all ()
311
319
You can’t perform that action at this time.
0 commit comments