File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change 3
3
import pytest
4
4
import pandas as pd
5
5
import numpy as np
6
+ from datetime import timedelta
6
7
7
8
from src .penn_chime .models import (
8
9
sir ,
9
10
sim_sir_df ,
10
11
get_growth_rate ,
12
+ SimSirModel ,
11
13
)
12
14
13
15
from src .penn_chime .constants import EPSILON
@@ -100,6 +102,20 @@ def test_model(model, param):
100
102
assert model .r_t == 2.307298374881539
101
103
assert model .r_naught == 2.7144686763312222
102
104
assert model .doubling_time_t == 7.764405988534983
105
+ assert model .i_day == 43
106
+
107
+
108
+ def test_model_first_hosp_fit (param ):
109
+ param .date_first_hospitalized = param .current_date - timedelta (days = 43 )
110
+ param .doubling_time = None
111
+
112
+ my_model = SimSirModel (param )
113
+
114
+ assert my_model .intrinsic_growth_rate == 0.12246204830937302
115
+ assert abs (my_model .beta - 4.21501347256401e-07 ) < EPSILON
116
+ assert my_model .r_t == 2.307298374881539
117
+ assert my_model .r_naught == 2.7144686763312222
118
+ assert my_model .doubling_time_t == 7.764405988534983
103
119
104
120
105
121
def test_model_raw_start (model , param ):
You can’t perform that action at this time.
0 commit comments