Changed % responses for P(i), now given as 0.1f (1 decimal place, unless <1 then 2dp as previously)

Modified alternative scenarios:
- The base case is no longer added to alternate scenarios
- HEPA/FFP2 options revised to make more sense
If using FFP2, no alternatives are added.
If using HEPA and FFP2, HEPA + Type 1 is included as an alternate
If using HEPA and Type I, HEPA + FFP2 is included as an alternate
This commit is contained in:
jdevine 2021-07-14 18:20:25 +02:00
parent 29a39040a5
commit 967127384f
2 changed files with 11 additions and 9 deletions

View file

@ -166,7 +166,7 @@ def non_zero_percentage(percentage: int) -> str:
elif percentage < 1:
return "{:0.2f}%".format(percentage)
else:
return "{:0.0f}%".format(percentage)
return "{:0.1f}%".format(percentage)
def manufacture_alternative_scenarios(form: FormData) -> typing.Dict[str, mc.ExposureModel]:
@ -175,11 +175,13 @@ def manufacture_alternative_scenarios(form: FormData) -> typing.Dict[str, mc.Exp
# Two special option cases - HEPA and/or FFP2 masks.
FFP2_being_worn = bool(form.mask_wearing_option == 'mask_on' and form.mask_type == 'FFP2')
if FFP2_being_worn and form.hepa_option:
scenarios['Base scenario with HEPA and FFP2 masks'] = form.build_mc_model()
elif FFP2_being_worn:
scenarios['Base scenario with FFP2 masks'] = form.build_mc_model()
elif form.hepa_option:
scenarios['Base scenario with HEPA filter'] = form.build_mc_model()
FFP2andHEPAalternative = dataclass_utils.replace(form, mask_type='Type I')
scenarios['Base scenario with HEPA filter and Type I masks'] = FFP2andHEPAalternative.build_mc_model()
if not FFP2_being_worn and form.hepa_option:
noHEPAalternative = dataclass_utils.replace(form, mask_type = 'FFP2')
noHEPAalternative = dataclass_utils.replace(noHEPAalternative, mask_wearing_option = 'mask_on')
noHEPAalternative = dataclass_utils.replace(noHEPAalternative, hepa_option=False)
scenarios['Base scenario without HEPA filter, with FFP2 masks'] = noHEPAalternative.build_mc_model()
# The remaining scenarios are based on Type I masks (possibly not worn)
# and no HEPA filtration.
@ -191,11 +193,11 @@ def manufacture_alternative_scenarios(form: FormData) -> typing.Dict[str, mc.Exp
without_mask = dataclass_utils.replace(form, mask_wearing_option='mask_off')
if form.ventilation_type == 'mechanical_ventilation':
scenarios['Mechanical ventilation with Type I masks'] = with_mask.build_mc_model()
#scenarios['Mechanical ventilation with Type I masks'] = with_mask.build_mc_model()
scenarios['Mechanical ventilation without masks'] = without_mask.build_mc_model()
elif form.ventilation_type == 'natural_ventilation':
scenarios['Windows open with Type I masks'] = with_mask.build_mc_model()
#scenarios['Windows open with Type I masks'] = with_mask.build_mc_model()
scenarios['Windows open without masks'] = without_mask.build_mc_model()
# No matter the ventilation scheme, we include scenarios which don't have any ventilation.

View file

@ -249,7 +249,7 @@
<ol>
<li>This graph shows the concentration of infectious quanta in the air. The filtration of Type I and FFP2 masks, if worn, applies not only to the emission rate but also to the individual exposure (i.e. inhalation).
For this reason, scenarios with different types of mask will show the same concentration on the graph but have different absorbed doses and infection probabilities.</li>
<li>If you have selected more sophisticated options, such as HEPA filtration or FFP2 masks, this will be indicated in the plot as the "base scenario", representing the inputs inserted in the form.<br>
<li>If you have selected more sophisticated options, such as HEPA filtration or FFP2 masks, alternatives will be indicated in the plot as the "base scenario with/without...", representing a variation on the inputs inserted in the form.<br>
The other alternative scenarios shown for comparison will not include either HEPA filtration or FFP2 masks.</li>
</ol>
<br>