Check relative error, not exact match
@@ -111,11 +111,11 @@ def test_model_first_hosp_fit(param):
my_model = SimSirModel(param)
- assert my_model.intrinsic_growth_rate == 0.1232387953882732
+ assert abs(my_model.intrinsic_growth_rate - 0.123) / 0.123 < 0.01
assert abs(my_model.beta - 4.21501347256401e-07) < EPSILON
- assert my_model.r_t == 2.316541665120451
- assert my_model.r_naught == 2.7253431354358253
- assert my_model.doubling_time_t == 7.712255171528787
+ assert abs(my_model.r_t - 2.32) / 2.32 < 0.01
+ assert abs(my_model.r_naught - 2.72) / 2.72 < 0.01
+ assert abs(my_model.doubling_time_t - 7.71)/7.71 < 0.01
def test_model_raw_start(model, param):
