diff --git a/cara/apps/calculator/model_generator.py b/cara/apps/calculator/model_generator.py index fda15b3c..7f6a2d50 100644 --- a/cara/apps/calculator/model_generator.py +++ b/cara/apps/calculator/model_generator.py @@ -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( diff --git a/cara/apps/expert.py b/cara/apps/expert.py index 9fb47963..560b3fbf 100644 --- a/cara/apps/expert.py +++ b/cara/apps/expert.py @@ -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), diff --git a/cara/models.py b/cara/models.py index 843e5571..9d9a4747 100644 --- a/cara/models.py +++ b/cara/models.py @@ -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 diff --git a/cara/tests/test_known_quantities.py b/cara/tests/test_known_quantities.py index 30e64447..336751f9 100644 --- a/cara/tests/test_known_quantities.py +++ b/cara/tests/test_known_quantities.py @@ -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(