Adjusted tests, modified expected outputs for new temperature and humidity dependent halflife method
This commit is contained in:
parent
52300df16b
commit
a85a05316f
5 changed files with 29 additions and 23 deletions
|
|
@ -462,7 +462,7 @@ class SARSCoV2(Virus):
|
|||
# Updated to use the formula from Dabish et al. https://doi.org/10.1080/02786826.2020.1829536
|
||||
# with a minimum at hl = 1.1
|
||||
inside_temp = inside_temp.value(time)
|
||||
return max(1.1, (0.693/(0.16030 + 0.04018*(((inside_temp-274.15)-20.615)/10.585)+0.02176*((humidity-45.235)/28.665)+0.1)))
|
||||
return max(1.1, (0.693/(0.16030 + 0.04018*(((inside_temp-273.15)-20.615)/10.585)+0.02176*((humidity-45.235)/28.665)+0.1)))
|
||||
|
||||
|
||||
Virus.types = {
|
||||
|
|
|
|||
|
|
@ -179,12 +179,12 @@ def sr_model():
|
|||
@pytest.mark.parametrize(
|
||||
["exposed_time_interval", "expected_deposited_exposure"],
|
||||
[
|
||||
[(0., 1.), 45.6008710],
|
||||
[(1., 1.01), 0.5280401],
|
||||
[(1.01, 1.02), 0.51314096385],
|
||||
[(12., 12.01), 0.016255813185],
|
||||
[(12., 24.), 645.63619275],
|
||||
[(0., 24.), 700.7322474],
|
||||
[(0., 1.), 48.19316],
|
||||
[(1., 1.01), 0.566368],
|
||||
[(1.01, 1.02), 0.551401],
|
||||
[(12., 12.01), 0.016278],
|
||||
[(12., 24.), 691.21381],
|
||||
[(0., 24.), 750.258043],
|
||||
]
|
||||
)
|
||||
def test_exposure_model_integral_accuracy(exposed_time_interval,
|
||||
|
|
|
|||
|
|
@ -47,6 +47,9 @@ class SimpleConcentrationModel:
|
|||
#: room volume (m^3)
|
||||
room_volume: _VectorisedFloat
|
||||
|
||||
#: The temperature inside the room (Kelvin).
|
||||
#inside_temp: float = 293.15
|
||||
|
||||
#: ventilation rate (air changes per hour) - including HEPA
|
||||
lambda_ventilation: _VectorisedFloat
|
||||
|
||||
|
|
@ -84,8 +87,11 @@ class SimpleConcentrationModel:
|
|||
"""
|
||||
removal rate lambda in h^-1, excluding the deposition rate.
|
||||
"""
|
||||
return (self.lambda_ventilation
|
||||
+ ln2/(6.43 if self.humidity<=0.4 else 1.1) )
|
||||
|
||||
return (self.lambda_ventilation
|
||||
+ ln2/(max(1.1, (0.693 / (0.16030 + 0.04018 * (((22) - 20.615) / 10.585) + 0.02176 * (
|
||||
(self.humidity - 45.235) / 28.665) + 0.1)))))
|
||||
#6.43 if self.humidity<=0.4 else 1.1) )
|
||||
|
||||
@method_cache
|
||||
def deposition_removal_coefficient(self) -> float:
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ def test_concentrations(baseline_concentration_model):
|
|||
concentrations = [baseline_concentration_model.concentration(float(t)) for t in ts]
|
||||
npt.assert_allclose(
|
||||
concentrations,
|
||||
[0.000000e+00, 20.805628, 6.602814e-13, 20.805628, 2.09545e-26],
|
||||
[0.000000e+00, 2.108144e+01, 1.004741e-12, 2.108144e+01, 4.788592e-26],
|
||||
rtol=1e-6
|
||||
)
|
||||
|
||||
|
|
@ -94,7 +94,7 @@ def test_r0(baseline_exposure_model):
|
|||
# expected r0 was computed with a trapezoidal integration, using
|
||||
# a mesh of 100'000 pts per exposed presence interval.
|
||||
r0 = baseline_exposure_model.reproduction_number()
|
||||
npt.assert_allclose(r0, 776.941990)
|
||||
npt.assert_allclose(r0, 781.293793)
|
||||
|
||||
|
||||
def test_periodic_window(baseline_periodic_window, baseline_room):
|
||||
|
|
@ -381,8 +381,8 @@ def build_exposure_model(concentration_model, short_range_model):
|
|||
@pytest.mark.parametrize(
|
||||
"month, expected_deposited_exposure",
|
||||
[
|
||||
['Jan', 377.440565819],
|
||||
['Jun', 1721.03336729],
|
||||
['Jan', 392.994454],
|
||||
['Jun', 2127.82386],
|
||||
],
|
||||
)
|
||||
def test_exposure_hourly_dep(month,expected_deposited_exposure, baseline_sr_model):
|
||||
|
|
@ -402,8 +402,8 @@ def test_exposure_hourly_dep(month,expected_deposited_exposure, baseline_sr_mode
|
|||
@pytest.mark.parametrize(
|
||||
"month, expected_deposited_exposure",
|
||||
[
|
||||
['Jan', 383.339206111],
|
||||
['Jun', 1799.17597184],
|
||||
['Jan', 394.000261],
|
||||
['Jun', 2239.777906],
|
||||
],
|
||||
)
|
||||
def test_exposure_hourly_dep_refined(month,expected_deposited_exposure, baseline_sr_model):
|
||||
|
|
|
|||
|
|
@ -310,13 +310,13 @@ def waiting_room_mc():
|
|||
@pytest.mark.parametrize(
|
||||
"mc_model, expected_pi, expected_new_cases, expected_dose, expected_ER",
|
||||
[
|
||||
["shared_office_mc", 6.03, 0.18, 3.198, 809],
|
||||
["shared_office_mc", 6.524158, 0.195725, 3.413983, 809],
|
||||
["classroom_mc", 9.5, 1.85, 9.478, 5624],
|
||||
["ski_cabin_mc", 16.0, 0.5, 17.315, 7966],
|
||||
["skagit_chorale_mc",65.7, 40.0, 102.213, 190422],
|
||||
["bus_ride_mc", 12.0, 8.0, 7.65, 5419],
|
||||
["skagit_chorale_mc",69.84901, 40.0, 121.265911, 190422],
|
||||
["bus_ride_mc", 13.311721, 8.918853, 8.6662, 5419],
|
||||
["gym_mc", 0.45, 0.13, 0.208, 1145],
|
||||
["waiting_room_mc", 1.59, 0.22, 0.821, 737],
|
||||
["waiting_room_mc", 1.854373, 0.259612, 0.99173, 737],
|
||||
]
|
||||
)
|
||||
def test_report_models(mc_model, expected_pi, expected_new_cases,
|
||||
|
|
@ -337,10 +337,10 @@ def test_report_models(mc_model, expected_pi, expected_new_cases,
|
|||
@pytest.mark.parametrize(
|
||||
"mask_type, month, expected_pi, expected_dose, expected_ER",
|
||||
[
|
||||
["No mask", "Jul", 9.52, 9.920, 809],
|
||||
["Type I", "Jul", 1.7, 0.913, 149],
|
||||
["FFP2", "Jul", 0.51, 0.239, 149],
|
||||
["Type I", "Feb", 0.57, 0.272, 162],
|
||||
["No mask", "Jul", 10.966992, 12.357222, 809],
|
||||
["Type I", "Jul", 2.084648, 1.137819, 149],
|
||||
["FFP2", "Jul", 0.654566, .309637, 149],
|
||||
["Type I", "Feb", 0.612366, 0.272, 162],
|
||||
],
|
||||
)
|
||||
def test_small_shared_office_Geneva(mask_type, month, expected_pi,
|
||||
|
|
|
|||
Loading…
Reference in a new issue