Skip to content

Commit

Permalink
Merge branch 'changes/data_schema' into 'master'
Browse files Browse the repository at this point in the history
Data registry update

See merge request caimira/caimira!509
  • Loading branch information
lrdossan committed Nov 25, 2024
2 parents 515c8ef + 78286ec commit 50edc1a
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 38 deletions.
10 changes: 5 additions & 5 deletions caimira/src/caimira/calculator/models/monte_carlo/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ def activity_distributions(data_registry):
}


# From https://doi.org/10.1101/2021.10.14.21264988 and references therein
# From https://doi.org/10.1098/rsfs.2021.0076 and references therein
def symptomatic_vl_frequencies(data_registry):
return param_evaluation(data_registry.virological_data, 'symptomatic_vl_frequencies')

Expand Down Expand Up @@ -419,8 +419,8 @@ def expiration_distributions(data_registry):
exp_type: expiration_distribution(
data_registry=data_registry,
BLO_factors=BLO_factors,
d_min=param_evaluation(data_registry.expiration_particle['long_range_particle_diameter'], 'minimum_diameter'),
d_max=param_evaluation(data_registry.expiration_particle['long_range_particle_diameter'], 'maximum_diameter')
d_min=param_evaluation(data_registry.expiration_particle['particle_size_range']['long_range'], 'minimum_diameter'),
d_max=param_evaluation(data_registry.expiration_particle['particle_size_range']['long_range'], 'maximum_diameter')
)
for exp_type, BLO_factors in expiration_BLO_factors(data_registry).items()
}
Expand All @@ -431,8 +431,8 @@ def short_range_expiration_distributions(data_registry):
exp_type: expiration_distribution(
data_registry=data_registry,
BLO_factors=BLO_factors,
d_min=param_evaluation(data_registry.expiration_particle['short_range_particle_diameter'], 'minimum_diameter'),
d_max=param_evaluation(data_registry.expiration_particle['short_range_particle_diameter'], 'maximum_diameter')
d_min=param_evaluation(data_registry.expiration_particle['particle_size_range']['short_range'], 'minimum_diameter'),
d_max=param_evaluation(data_registry.expiration_particle['particle_size_range']['short_range'], 'maximum_diameter')
)
for exp_type, BLO_factors in expiration_BLO_factors(data_registry).items()
}
Expand Down
80 changes: 47 additions & 33 deletions caimira/src/caimira/calculator/store/data_registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,18 @@ class DataRegistry:
version = None

expiration_particle = {
"long_range_particle_diameter": {
"minimum_diameter": 0.1,
"maximum_diameter": 30,
"references": "Morawska et al. (https://doi.org/10.1016/j.jaerosci.2008.11.002); Johnson et al. (https://doi.org/10.1016/j.jaerosci.2011.07.009).",
},
"short_range_particle_diameter": {
"minimum_diameter": 0.1,
"maximum_diameter": 100,
"references": "Morawska et al. (https://doi.org/10.1016/j.jaerosci.2008.11.002); Johnson et al. (https://doi.org/10.1016/j.jaerosci.2011.07.009).",
},
"particle_size_range": {
"long_range": {
"minimum_diameter": 0.1,
"maximum_diameter": 30,
"references": "Morawska et al. (https://doi.org/10.1016/j.jaerosci.2008.11.002); Johnson et al. (https://doi.org/10.1016/j.jaerosci.2011.07.009).",
},
"short_range": {
"minimum_diameter": 0.1,
"maximum_diameter": 100,
"references": "Morawska et al. (https://doi.org/10.1016/j.jaerosci.2008.11.002); Johnson et al. (https://doi.org/10.1016/j.jaerosci.2011.07.009).",
},
},
"BLOmodel": {
"cn": {"B": 0.06, "L": 0.2, "O": 0.0010008},
"mu": {"B": 0.989541, "L": 1.38629, "O": 4.97673},
Expand Down Expand Up @@ -244,15 +246,15 @@ class DataRegistry:
"viable_to_RNA_ratio": {
"associated_value": "Uniform distribution",
"parameters": {"low": 0.01, "high": 0.6},
"references": "",
"references": "Henriques et al. (https://doi.org/10.1098/rsfs.2021.0076) and references therein.",
},
"transmissibility_factor": {
"value": 1,
"references": "Campbell et al. (https://doi.org/10.2807/1560-7917.ES.2021.26.24.2100509.)",
},
"infectiousness_days": {
"value": 14,
"references": "",
"references": "From French and Swiss guidelines (2021), supported by WHO (https://iris.who.int/bitstream/handle/10665/342004/WHO-2019-nCoV-IHR-Quarantine-2021.1-eng.pdf). Only used for incidence rate calculations.",
},
},
"SARS_CoV_2_ALPHA": {
Expand All @@ -265,15 +267,15 @@ class DataRegistry:
"viable_to_RNA_ratio": {
"associated_value": "Uniform distribution",
"parameters": {"low": 0.01, "high": 0.6},
"references": "",
"references": "Henriques et al. (https://doi.org/10.1098/rsfs.2021.0076) and references therein.",
},
"transmissibility_factor": {
"value": 0.78,
"references": "Campbell et al. (https://doi.org/10.2807/1560-7917.ES.2021.26.24.2100509.)",
},
"infectiousness_days": {
"value": 14,
"references": "",
"references": "From French and Swiss guidelines (2021), supported by WHO (https://iris.who.int/bitstream/handle/10665/342004/WHO-2019-nCoV-IHR-Quarantine-2021.1-eng.pdf). Only used for incidence rate calculations.",
},
},
"SARS_CoV_2_BETA": {
Expand All @@ -286,15 +288,15 @@ class DataRegistry:
"viable_to_RNA_ratio": {
"associated_value": "Uniform distribution",
"parameters": {"low": 0.01, "high": 0.6},
"references": "",
"references": "Henriques et al. (https://doi.org/10.1098/rsfs.2021.0076) and references therein.",
},
"transmissibility_factor": {
"value": 0.8,
"references": "Campbell et al. (https://doi.org/10.2807/1560-7917.ES.2021.26.24.2100509.)",
},
"infectiousness_days": {
"value": 14,
"references": "",
"references": "From French and Swiss guidelines (2021), supported by WHO (https://iris.who.int/bitstream/handle/10665/342004/WHO-2019-nCoV-IHR-Quarantine-2021.1-eng.pdf). Only used for incidence rate calculations.",
},
},
"SARS_CoV_2_GAMMA": {
Expand All @@ -307,15 +309,15 @@ class DataRegistry:
"viable_to_RNA_ratio": {
"associated_value": "Uniform distribution",
"parameters": {"low": 0.01, "high": 0.6},
"references": "",
"references": "Henriques et al. (https://doi.org/10.1098/rsfs.2021.0076) and references therein.",
},
"transmissibility_factor": {
"value": 0.72,
"references": "Campbell et al. (https://doi.org/10.2807/1560-7917.ES.2021.26.24.2100509.)",
},
"infectiousness_days": {
"value": 14,
"references": "",
"references": "From French and Swiss guidelines (2021), supported by WHO (https://iris.who.int/bitstream/handle/10665/342004/WHO-2019-nCoV-IHR-Quarantine-2021.1-eng.pdf). Only used for incidence rate calculations.",
},
},
"SARS_CoV_2_DELTA": {
Expand All @@ -328,15 +330,15 @@ class DataRegistry:
"viable_to_RNA_ratio": {
"associated_value": "Uniform distribution",
"parameters": {"low": 0.01, "high": 0.6},
"references": "",
"references": "Henriques et al. (https://doi.org/10.1098/rsfs.2021.0076) and references therein.",
},
"transmissibility_factor": {
"value": 0.51,
"references": "Campbell et al. (https://doi.org/10.2807/1560-7917.ES.2021.26.24.2100509.)",
},
"infectiousness_days": {
"value": 14,
"references": "",
"references": "From French and Swiss guidelines (2021), supported by WHO (https://iris.who.int/bitstream/handle/10665/342004/WHO-2019-nCoV-IHR-Quarantine-2021.1-eng.pdf). Only used for incidence rate calculations.",
},
},
"SARS_CoV_2_OMICRON": {
Expand All @@ -349,15 +351,15 @@ class DataRegistry:
"viable_to_RNA_ratio": {
"associated_value": "Uniform distribution",
"parameters": {"low": 0.01, "high": 0.6},
"references": "",
"references": "Henriques et al. (https://doi.org/10.1098/rsfs.2021.0076) and references therein.",
},
"transmissibility_factor": {
"value": 0.2,
"references": "",
"references": "Du et al. (https://www.mdpi.com/1999-4915/14/4/821).",
},
"infectiousness_days": {
"value": 14,
"references": "",
"references": "From French and Swiss guidelines (2021), supported by WHO (https://iris.who.int/bitstream/handle/10665/342004/WHO-2019-nCoV-IHR-Quarantine-2021.1-eng.pdf). Only used for incidence rate calculations.",
},
},
},
Expand Down Expand Up @@ -422,7 +424,7 @@ class DataRegistry:
"inside_temp": 293.,
"humidity_with_heating": 0.3,
"humidity_without_heating": 0.5,
"references": "",
"references": "N/A.",
}

ventilation = {
Expand All @@ -438,12 +440,12 @@ class DataRegistry:
concentration_model = {
"virus_concentration_model": {
"min_background_concentration": 0.0,
"references": "",
"references": "N/A.",
},
"CO2_concentration_model": {
"CO2_atmosphere_concentration": 440.44,
"CO2_fraction_exhaled": 0.042,
"references": "",
"references": "ECMWF - https://charts.ecmwf.int/products/carbon-dioxide-forecasts; Zhang et al. (https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7127751/).",
},
}

Expand All @@ -468,77 +470,89 @@ class DataRegistry:

monte_carlo = {
"sample_size": 250000,
"references": "",
"references": "N/A.",
}

population_scenario_activity = {
"office": {"placeholder": "Office", "activity": "Seated", "expiration": {"Speaking": 1, "Breathing": 2}},
"office": {"placeholder": "Office", "activity": "Seated", "expiration": {"Speaking": 1, "Breathing": 2}, "references": "N/A."},
"smallmeeting": {
"placeholder": "Small meeting (<10 occ.)",
"activity": "Seated",
"expiration": {"Speaking": 1},
"references": "N/A.",
},
"largemeeting": {
"placeholder": "Large meeting (>= 10 occ.)",
"activity": "Standing",
"expiration": {"Speaking": 1, "Breathing": 2},
"references": "N/A.",
},
"callcenter": {"placeholder": "Call Center", "activity": "Seated", "expiration": {"Speaking": 1}},
"controlroom-day": {
"placeholder": "Control Room - Day shift",
"activity": "Seated",
"expiration": {"Speaking": 1, "Breathing": 1},
"references": "N/A.",
},
"controlroom-night": {
"placeholder": "Control Room - Night shift",
"activity": "Seated",
"expiration": {"Speaking": 1, "Breathing": 9},
"references": "N/A.",
},
"library": {"placeholder": "Library", "activity": "Seated", "expiration": {"Breathing": 1}},
"library": {"placeholder": "Library", "activity": "Seated", "expiration": {"Breathing": 1}, "references": "N/A."},
"lab": {
"placeholder": "Lab",
"activity": "Light activity",
"expiration": {"Speaking": 1, "Breathing": 1},
"references": "N/A.",
},
"workshop": {
"placeholder": "Workshop",
"activity": "Moderate activity",
"expiration": {"Speaking": 1, "Breathing": 1},
"references": "N/A.",
},
"training": {"placeholder": "Conference/Training (speaker infected)", "activity": "Standing", "expiration": {"Speaking": 1}},
"training_attendee": {"placeholder": "Conference/Training (attendee infected)", "activity": "Seated", "expiration": {"Breathing": 1}},
"gym": {"placeholder": "Gym", "activity": "Heavy exercise", "expiration": {"Breathing": 1}},
"training": {"placeholder": "Conference/Training (speaker infected)", "activity": "Standing", "expiration": {"Speaking": 1}, "references": "N/A."},
"training_attendee": {"placeholder": "Conference/Training (attendee infected)", "activity": "Seated", "expiration": {"Breathing": 1}, "references": "N/A."},
"gym": {"placeholder": "Gym", "activity": "Heavy exercise", "expiration": {"Breathing": 1}, "references": "N/A."},
"household-day": {
"placeholder": "Household (day time)",
"activity": "Light activity",
"expiration": {"Breathing": 5, "Speaking": 5},
"references": "N/A.",
},
"household-night": {
"placeholder": "Household (evening and night time)",
"activity": "Seated",
"expiration": {"Breathing": 7, "Speaking": 3},
"references": "N/A."
},
"primary-school": {
"placeholder": "Primary school",
"activity": "Light activity",
"expiration": {"Breathing": 5, "Speaking": 5},
"references": "N/A.",
},
"secondary-school": {
"placeholder": "Secondary school",
"activity": "Light activity",
"expiration": {"Breathing": 7, "Speaking": 3},
"references": "N/A.",
},
"university": {
"placeholder": "University",
"activity": "Seated",
"expiration": {"Breathing": 9, "Speaking": 1},
"references": "N/A.",
},
"restaurant": {
"placeholder": "Restaurant",
"activity": "Seated",
"expiration": {"Breathing": 1, "Speaking": 9},
"references": "N/A.",
},
"precise": {"placeholder": "Precise", "activity": "", "expiration": {}},
"precise": {"placeholder": "Precise", "activity": "", "expiration": {}, "references": "N/A."},
}

def to_dict(self):
Expand Down

0 comments on commit 50edc1a

Please sign in to comment.