Skip to content

Commit d6be46a

Browse files
committed
Fix drifting p.current_date
1 parent a251c8e commit d6be46a

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

tests/test_app.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
)
5252

5353
PARAM = Parameters(
54+
current_date=datetime(year=2020, month=3, day=28),
5455
current_hospitalized=100,
5556
doubling_time=6.0,
5657
market_share=0.05,
@@ -63,6 +64,7 @@
6364
)
6465

6566
HALVING_PARAM = Parameters(
67+
current_date=datetime(year=2020, month=3, day=28),
6668
current_hospitalized=100,
6769
doubling_time=6.0,
6870
market_share=0.05,
@@ -287,19 +289,19 @@ def test_model_raw_start():
287289

288290
# test the things n_days creates, which in turn tests sim_sir, sir, and get_dispositions
289291

290-
# print('n_days: %s; i_day: %s' % (param.n_days, model.i_day))
292+
print('n_days: %s; i_day: %s' % (param.n_days, model.i_day))
291293
assert len(raw_df) == (len(np.arange(-model.i_day, param.n_days + 1))) == 104
292294

293295
first = raw_df.iloc[0, :]
294296
second = raw_df.iloc[1, :]
295297

296298
assert first.susceptible == 499600.0
297299
assert round(second.infected, 0) == 449.0
298-
assert list(model.dispositions_df.iloc[0, :]) == [-43, date(year=2020, month=2, day=15), 1.0, 0.4, 0.2]
300+
assert list(model.dispositions_df.iloc[0, :]) == [-43, date(year=2020, month=2, day=14), 1.0, 0.4, 0.2]
299301
assert round(raw_df.recovered[30], 0) == 7083.0
300302

301303
d, dt, s, i, r = list(model.dispositions_df.iloc[60, :])
302-
assert dt == date(year=2020, month=4, day=15)
304+
assert dt == date(year=2020, month=4, day=14)
303305
assert [round(v, 0) for v in (d, s, i, r)] == [17, 549.0, 220.0, 110.0]
304306

305307

0 commit comments

Comments
 (0)