renamed and moved total_people for short-range interactions to the exposure model

This commit is contained in:
Luis Aleixo 2024-05-15 11:17:08 +02:00
parent 70dc4a93d6
commit a54da08789
2 changed files with 5 additions and 5 deletions

View file

@ -223,7 +223,6 @@ class VirusFormData(FormData):
activity=infected_population.activity,
presence=self.short_range_interval(interaction),
distance=short_range_distances(self.data_registry),
total_people=self.short_range_total_people,
))
return mc.ExposureModel(
@ -242,6 +241,7 @@ class VirusFormData(FormData):
geographic_cases=self.geographic_cases,
ascertainment_bias=CONFIDENCE_LEVEL_OPTIONS[self.ascertainment_bias],
),
exposed_to_short_range=self.short_range_total_people,
)
def build_model(self, sample_size=None) -> models.ExposureModel:

View file

@ -1331,9 +1331,6 @@ class ShortRangeModel:
#: Interpersonal distances
distance: _VectorisedFloat
#: Total people with short-range interactions
total_people: int = 1
def dilution_factor(self) -> _VectorisedFloat:
'''
The dilution factor for the respective expiratory activity type.
@ -1582,6 +1579,9 @@ class ExposureModel:
#: Geographical data
geographical_data: Cases
#: Total people with short-range interactions
exposed_to_short_range: int = 1
#: The number of times the exposure event is repeated (default 1).
@property
def repeats(self) -> int:
@ -1821,7 +1821,7 @@ class ExposureModel:
"""
# If short-range interaction are defined, the total exposed people
# is only those of the short-range interactions.
exposed = self.short_range[0].total_people if self.short_range != () else self.exposed.number
exposed = self.exposed_to_short_range if self.short_range != () else self.exposed.number
return self.infection_probability() * exposed / 100