use smaller fixtures
This commit is contained in:
parent
ea47010e3b
commit
ffd0bc80cd
1 changed files with 14 additions and 37 deletions
|
|
@ -44,42 +44,19 @@ def baseline_model():
|
|||
|
||||
|
||||
@pytest.fixture
|
||||
def periodic_opening_model():
|
||||
model = models.Model(
|
||||
room=models.Room(volume=75),
|
||||
ventilation=models.PeriodicWindow(period=120, duration=15, inside_temp=293, outside_temp=283, cd_b=0.6,
|
||||
window_height=1.6, opening_length=0.6),
|
||||
infected=models.InfectedPerson(
|
||||
virus=models.Virus.types['SARS_CoV_2'],
|
||||
present_times=((0, 4), (5, 8)),
|
||||
mask=models.Mask.types['No mask'],
|
||||
activity=models.Activity.types['Light exercise'],
|
||||
expiration=models.Expiration.types['Unmodulated Vocalization'],
|
||||
),
|
||||
infected_occupants=1,
|
||||
exposed_occupants=10,
|
||||
exposed_activity=models.Activity.types['Light exercise'],
|
||||
)
|
||||
return model
|
||||
def baseline_periodic_window():
|
||||
return models.PeriodicWindow(period=120, duration=15, inside_temp=293, outside_temp=283, cd_b=0.6,
|
||||
window_height=1.6, opening_length=0.6)
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def periodic_hepa_model():
|
||||
model = models.Model(
|
||||
room=models.Room(volume=75),
|
||||
ventilation=models.PeriodicHEPA(period=120, duration=15, q_air_mech=514.74),
|
||||
infected=models.InfectedPerson(
|
||||
virus=models.Virus.types['SARS_CoV_2'],
|
||||
present_times=((0, 4), (5, 8)),
|
||||
mask=models.Mask.types['No mask'],
|
||||
activity=models.Activity.types['Light exercise'],
|
||||
expiration=models.Expiration.types['Unmodulated Vocalization'],
|
||||
),
|
||||
infected_occupants=1,
|
||||
exposed_occupants=10,
|
||||
exposed_activity=models.Activity.types['Light exercise'],
|
||||
)
|
||||
return model
|
||||
def baseline_room():
|
||||
return models.Room(volume=75)
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def baseline_periodic_hepa():
|
||||
return models.PeriodicHEPA(period=120, duration=15, q_air_mech=514.74)
|
||||
|
||||
|
||||
def test_r0(baseline_model):
|
||||
|
|
@ -93,15 +70,15 @@ def test_r0(baseline_model):
|
|||
)
|
||||
|
||||
|
||||
def test_periodic_window(periodic_opening_model):
|
||||
def test_periodic_window(baseline_periodic_window, baseline_room):
|
||||
ts = linspace(0, 9 * 60, 9)
|
||||
aes = [periodic_opening_model.ventilation.air_exchange(periodic_opening_model.room, t) for t in ts]
|
||||
aes = [baseline_periodic_window.air_exchange(baseline_room, t) for t in ts]
|
||||
answers = [0, 0, 0, 0, 0, 0, 0, 514.76 / 75, 0]
|
||||
npt.assert_allclose(aes, answers, rtol=1e-5)
|
||||
|
||||
|
||||
def test_periodic_hepa(periodic_hepa_model):
|
||||
def test_periodic_hepa(baseline_periodic_hepa, baseline_room):
|
||||
ts = linspace(0, 9 * 60, 9)
|
||||
aes = [periodic_hepa_model.ventilation.air_exchange(periodic_hepa_model.room, t) for t in ts]
|
||||
aes = [baseline_periodic_hepa.air_exchange(baseline_room, t) for t in ts]
|
||||
answers = [0, 0, 0, 0, 0, 0, 0, 514.74 / 75, 0]
|
||||
npt.assert_allclose(aes, answers, rtol=1e-5)
|
||||
|
|
|
|||
Loading…
Reference in a new issue