Modifying infected populations tests and concentration tests, according to the new Mask class
This commit is contained in:
parent
fa0550233c
commit
26075cd53c
2 changed files with 8 additions and 13 deletions
|
|
@ -1,6 +1,7 @@
|
|||
import re
|
||||
|
||||
import numpy as np
|
||||
import numpy.testing as npt
|
||||
import pytest
|
||||
|
||||
from cara import models
|
||||
|
|
@ -13,8 +14,7 @@ from cara import models
|
|||
{'air_change': np.array([100, 120])},
|
||||
{'viral_load_in_sputum': np.array([5e8, 1e9])},
|
||||
{'quantum_infectious_dose': np.array([50, 20])},
|
||||
{'η_exhale': np.array([0.92, 0.95])},
|
||||
{'η_leaks': np.array([0.15, 0.20])},
|
||||
{'factor_exhale': np.array([0.92, 0.95])},
|
||||
]
|
||||
)
|
||||
def test_concentration_model_vectorisation(override_params):
|
||||
|
|
@ -24,8 +24,7 @@ def test_concentration_model_vectorisation(override_params):
|
|||
'air_change': 100,
|
||||
'viral_load_in_sputum': 1e9,
|
||||
'quantum_infectious_dose': 50,
|
||||
'η_exhale': 0.95,
|
||||
'η_leaks': 0.15,
|
||||
'factor_exhale': 0.95,
|
||||
}
|
||||
defaults.update(override_params)
|
||||
|
||||
|
|
@ -37,8 +36,7 @@ def test_concentration_model_vectorisation(override_params):
|
|||
number=1,
|
||||
presence=always,
|
||||
mask=models.Mask(
|
||||
η_exhale=defaults['η_exhale'],
|
||||
η_leaks=defaults['η_leaks'],
|
||||
factor_exhale=defaults['factor_exhale'],
|
||||
η_inhale=0.3,
|
||||
),
|
||||
activity=models.Activity(
|
||||
|
|
@ -128,4 +126,4 @@ def test_integrated_concentration(simple_conc_model):
|
|||
c2 = simple_conc_model.integrated_concentration(0, 1)
|
||||
c3 = simple_conc_model.integrated_concentration(1, 2)
|
||||
assert c1 != 0
|
||||
assert c1 == c2 + c3
|
||||
npt.assert_almost_equal(c1, c2 + c3, decimal=15)
|
||||
|
|
|
|||
|
|
@ -8,8 +8,7 @@ import cara.models
|
|||
"override_params", [
|
||||
{'viral_load_in_sputum': np.array([5e8, 1e9])},
|
||||
{'quantum_infectious_dose': np.array([50, 20])},
|
||||
{'η_exhale': np.array([0.92, 0.95])},
|
||||
{'η_leaks': np.array([0.15, 0.20])},
|
||||
{'factor_exhale': np.array([0.92, 0.95])},
|
||||
{'exhalation_rate': np.array([0.75, 0.81])},
|
||||
]
|
||||
)
|
||||
|
|
@ -17,8 +16,7 @@ def test_infected_population_vectorisation(override_params):
|
|||
defaults = {
|
||||
'viral_load_in_sputum': 1e9,
|
||||
'quantum_infectious_dose': 50,
|
||||
'η_exhale': 0.95,
|
||||
'η_leaks': 0.15,
|
||||
'factor_exhale': 0.95,
|
||||
'exhalation_rate': 0.75,
|
||||
}
|
||||
defaults.update(override_params)
|
||||
|
|
@ -28,8 +26,7 @@ def test_infected_population_vectorisation(override_params):
|
|||
number=1,
|
||||
presence=office_hours,
|
||||
mask=cara.models.Mask(
|
||||
η_exhale=defaults['η_exhale'],
|
||||
η_leaks=defaults['η_leaks'],
|
||||
factor_exhale=defaults['factor_exhale'],
|
||||
η_inhale=0.3,
|
||||
),
|
||||
activity=cara.models.Activity(
|
||||
|
|
|
|||
Loading…
Reference in a new issue