Rename Model to ConcentrationModel.
This commit is contained in:
parent
200e7cb14b
commit
7b43eb0ea5
4 changed files with 11 additions and 11 deletions
|
|
@ -113,7 +113,7 @@ class FormData:
|
|||
infected_finish=time_string_to_minutes(form_data['infected_finish']),
|
||||
)
|
||||
|
||||
def build_model(self) -> models.Model:
|
||||
def build_model(self) -> models.ExposureModel:
|
||||
return model_from_form(self)
|
||||
|
||||
def ventilation(self) -> models.Ventilation:
|
||||
|
|
@ -251,7 +251,7 @@ def model_from_form(form: FormData) -> models.ExposureModel:
|
|||
|
||||
# Initializes and returns a model with the attributes defined above
|
||||
return models.ExposureModel(
|
||||
concentration_model=models.Model(
|
||||
concentration_model=models.ConcentrationModel(
|
||||
room=room,
|
||||
ventilation=form.ventilation(),
|
||||
infected=models.InfectedPopulation(
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ class ConcentrationFigure:
|
|||
self.ax = self.figure.add_subplot(1, 1, 1)
|
||||
self.line = None
|
||||
|
||||
def update(self, model: models.Model):
|
||||
def update(self, model: models.ConcentrationModel):
|
||||
resolution = 600
|
||||
ts = np.linspace(0, 10, resolution)
|
||||
concentration = [model.concentration(t) for t in ts]
|
||||
|
|
@ -284,7 +284,7 @@ class WidgetView:
|
|||
|
||||
|
||||
baseline_model = models.ExposureModel(
|
||||
concentration_model=models.Model(
|
||||
concentration_model=models.ConcentrationModel(
|
||||
room=models.Room(volume=75),
|
||||
ventilation=models.WindowOpening(
|
||||
active=models.PeriodicInterval(period=120, duration=120),
|
||||
|
|
|
|||
|
|
@ -467,7 +467,7 @@ class InfectedPopulation(Population):
|
|||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class Model:
|
||||
class ConcentrationModel:
|
||||
room: Room
|
||||
ventilation: Ventilation
|
||||
infected: InfectedPopulation
|
||||
|
|
@ -528,7 +528,7 @@ class Model:
|
|||
@dataclass(frozen=True)
|
||||
class ExposureModel:
|
||||
#: The virus concentration model which this exposure model should consider.
|
||||
concentration_model: Model
|
||||
concentration_model: ConcentrationModel
|
||||
|
||||
#: The population of non-infected people to be used in the model.
|
||||
exposed: Population
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ def test_no_mask_emission_rate(baseline_model):
|
|||
|
||||
@pytest.fixture
|
||||
def baseline_model():
|
||||
model = models.Model(
|
||||
model = models.ConcentrationModel(
|
||||
room=models.Room(volume=75),
|
||||
ventilation=models.WindowOpening(
|
||||
active=models.PeriodicInterval(period=120, duration=120),
|
||||
|
|
@ -103,7 +103,7 @@ def test_smooth_concentrations(baseline_model):
|
|||
|
||||
|
||||
def build_model(interval_duration):
|
||||
model = models.Model(
|
||||
model = models.ConcentrationModel(
|
||||
room=models.Room(volume=75),
|
||||
ventilation=models.HEPAFilter(
|
||||
active=models.PeriodicInterval(period=120, duration=interval_duration),
|
||||
|
|
@ -322,7 +322,7 @@ def build_hourly_dependent_model(month, intervals_open=((7.5, 8.5),),
|
|||
else:
|
||||
outside_temp = temperatures[month]
|
||||
|
||||
model = models.Model(
|
||||
model = models.ConcentrationModel(
|
||||
room=models.Room(volume=75),
|
||||
ventilation=models.WindowOpening(
|
||||
active=models.SpecificInterval(intervals_open),
|
||||
|
|
@ -343,7 +343,7 @@ def build_hourly_dependent_model(month, intervals_open=((7.5, 8.5),),
|
|||
|
||||
|
||||
def build_constant_temp_model(outside_temp, intervals_open=((7.5, 8.5),)):
|
||||
model = models.Model(
|
||||
model = models.ConcentrationModel(
|
||||
room=models.Room(volume=75),
|
||||
ventilation=models.WindowOpening(
|
||||
active=models.SpecificInterval(intervals_open),
|
||||
|
|
@ -375,7 +375,7 @@ def build_hourly_dependent_model_multipleventilation(month, intervals_open=((7.5
|
|||
active=models.SpecificInterval(((0,24),)),
|
||||
q_air_mech=500.,
|
||||
)))
|
||||
model = models.Model(
|
||||
model = models.ConcentrationModel(
|
||||
room=models.Room(volume=75),
|
||||
ventilation=vent,
|
||||
infected=models.InfectedPopulation(
|
||||
|
|
|
|||
Loading…
Reference in a new issue