Merge remote-tracking branch 'origin/feature/virions_plot' into feature/virions_plot
This commit is contained in:
commit
4dac6237c2
2 changed files with 24 additions and 8 deletions
|
|
@ -50,7 +50,6 @@ from .utils import method_cache
|
|||
|
||||
from .dataclass_utils import nested_replace
|
||||
|
||||
|
||||
# Define types for items supporting vectorisation. In the future this may be replaced
|
||||
# by ``np.ndarray[<type>]`` once/if that syntax is supported. Note that vectorization
|
||||
# implies 1d arrays: multi-dimensional arrays are not supported.
|
||||
|
|
@ -429,6 +428,9 @@ class Virus:
|
|||
#: Dose to initiate infection, in RNA copies
|
||||
infectious_dose: _VectorisedFloat
|
||||
|
||||
#: viable-to-RNA virus ratio as a function of the viral load
|
||||
viable_to_RNA: _VectorisedFloat
|
||||
|
||||
#: Pre-populated examples of Viruses.
|
||||
types: typing.ClassVar[typing.Dict[str, "Virus"]]
|
||||
|
||||
|
|
@ -465,19 +467,23 @@ Virus.types = {
|
|||
# as per https://www.dhs.gov/publication/st-master-question-list-covid-19
|
||||
# 50 comes from Buonanno et al.
|
||||
infectious_dose=50.,
|
||||
viable_to_RNA = 0.5,
|
||||
),
|
||||
'SARS_CoV_2_B117': SARSCoV2(
|
||||
# also called VOC-202012/01
|
||||
viral_load_in_sputum=1e9,
|
||||
infectious_dose=30.,
|
||||
viable_to_RNA = 0.5,
|
||||
),
|
||||
'SARS_CoV_2_P1': SARSCoV2(
|
||||
viral_load_in_sputum=1e9,
|
||||
infectious_dose=1/0.045,
|
||||
viable_to_RNA = 0.5,
|
||||
),
|
||||
'SARS_CoV_2_B16172': SARSCoV2(
|
||||
viral_load_in_sputum=1e9,
|
||||
infectious_dose=30/1.6,
|
||||
viable_to_RNA = 0.5,
|
||||
),
|
||||
}
|
||||
|
||||
|
|
@ -539,7 +545,7 @@ class _ExpirationBase:
|
|||
#: Pre-populated examples of Expirations.
|
||||
types: typing.ClassVar[typing.Dict[str, "_ExpirationBase"]]
|
||||
|
||||
def aerosols(self, mask: Mask):
|
||||
def aerosols(self, mask: Mask, cn_B: float, cn_L: float):
|
||||
"""
|
||||
total volume of aerosols expired per volume of air (mL/cm^3).
|
||||
"""
|
||||
|
|
@ -608,9 +614,9 @@ class MultipleExpiration(_ExpirationBase):
|
|||
raise ValueError("expirations and weigths should contain the"
|
||||
"same number of elements")
|
||||
|
||||
def aerosols(self, mask: Mask):
|
||||
def aerosols(self, mask: Mask, cn_B: float, cn_L: float):
|
||||
return np.array([
|
||||
weight * expiration.aerosols(mask) / sum(self.weights)
|
||||
weight * expiration.aerosols(mask, cn_B, cn_L) / sum(self.weights)
|
||||
for weight,expiration in zip(self.weights,self.expirations)
|
||||
]).sum(axis=0)
|
||||
|
||||
|
|
@ -676,7 +682,11 @@ class InfectedPopulation(Population):
|
|||
#: The type of expiration that is being emitted whilst doing the activity.
|
||||
expiration: _ExpirationBase
|
||||
|
||||
def emission_rate_when_present(self, cn_B: float, cn_L: float) -> _VectorisedFloat:
|
||||
#: The percentage of host immunity
|
||||
host_immunity: float = 0.
|
||||
|
||||
|
||||
def emission_rate_when_present(self, cn_B: float = 0.06, cn_L: float = 0.2) -> _VectorisedFloat:
|
||||
"""
|
||||
The emission rate if the infected population is present.
|
||||
|
||||
|
|
@ -718,7 +728,7 @@ class InfectedPopulation(Population):
|
|||
# with a declaration of state change time, as is the case for things
|
||||
# like Ventilation.
|
||||
|
||||
return self.emission_rate_when_present()
|
||||
return self.emission_rate_when_present(cn_B=0.06, cn_L=0.2)
|
||||
|
||||
def emission_rate(self, time) -> _VectorisedFloat:
|
||||
"""
|
||||
|
|
@ -888,11 +898,13 @@ class ExposureModel:
|
|||
|
||||
def infection_probability(self) -> _VectorisedFloat:
|
||||
exposure = self.exposure()
|
||||
print('oi', self.concentration_model.infected.virus.viable_to_RNA)
|
||||
|
||||
# Dose
|
||||
inf_aero = (
|
||||
self.exposed.activity.inhalation_rate *
|
||||
(1 - self.exposed.mask.inhale_efficiency()) *
|
||||
exposure * self.fraction_deposited
|
||||
exposure * self.fraction_deposited * (self.concentration_model.infected.virus.viable_to_RNA * (1 - self.concentration_model.infected.host_immunity))
|
||||
)
|
||||
|
||||
# Probability of infection.
|
||||
|
|
|
|||
|
|
@ -44,18 +44,22 @@ virus_distributions = {
|
|||
'SARS_CoV_2': mc.SARSCoV2(
|
||||
viral_load_in_sputum=symptomatic_vl_frequencies,
|
||||
infectious_dose=100,
|
||||
viable_to_RNA=Uniform(0.15, 0.45),
|
||||
),
|
||||
'SARS_CoV_2_B117': mc.SARSCoV2(
|
||||
viral_load_in_sputum=symptomatic_vl_frequencies,
|
||||
infectious_dose=60,
|
||||
viable_to_RNA=Uniform(0.15, 0.45),
|
||||
),
|
||||
'SARS_CoV_2_P1': mc.SARSCoV2(
|
||||
viral_load_in_sputum=symptomatic_vl_frequencies,
|
||||
infectious_dose=100/2.25,
|
||||
viable_to_RNA=Uniform(0.15, 0.45),
|
||||
),
|
||||
'SARS_CoV_2_B16172': mc.SARSCoV2(
|
||||
viral_load_in_sputum=symptomatic_vl_frequencies,
|
||||
infectious_dose=60/1.6,
|
||||
viable_to_RNA=Uniform(0.15, 0.45),
|
||||
),
|
||||
}
|
||||
|
||||
|
|
@ -67,4 +71,4 @@ virus_distributions = {
|
|||
mask_distributions = {
|
||||
'Type I': mc.Mask(Uniform(0.25, 0.80)),
|
||||
'FFP2': mc.Mask(Uniform(0.83, 0.91)),
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue