added checkbox for conditional probability generation
This commit is contained in:
parent
8b25fb631c
commit
f199e974d5
4 changed files with 13 additions and 2 deletions
|
|
@ -36,6 +36,7 @@ class FormData:
|
|||
specific_breaks: dict
|
||||
precise_activity: dict
|
||||
ceiling_height: float
|
||||
conditional_probability_plot: bool
|
||||
exposed_coffee_break_option: str
|
||||
exposed_coffee_duration: int
|
||||
exposed_finish: minutes_since_midnight
|
||||
|
|
@ -104,6 +105,7 @@ class FormData:
|
|||
'precise_activity': '{}',
|
||||
'calculator_version': _NO_DEFAULT,
|
||||
'ceiling_height': 0.,
|
||||
'conditional_probability_plot': False,
|
||||
'exposed_coffee_break_option': 'coffee_break_0',
|
||||
'exposed_coffee_duration': 5,
|
||||
'exposed_finish': '17:30',
|
||||
|
|
@ -900,6 +902,7 @@ def baseline_raw_form_data() -> typing.Dict[str, typing.Union[str, float]]:
|
|||
'air_changes': '',
|
||||
'air_supply': '',
|
||||
'ceiling_height': '',
|
||||
'conditional_probability_plot': '0',
|
||||
'exposed_coffee_break_option': 'coffee_break_4',
|
||||
'exposed_coffee_duration': '10',
|
||||
'exposed_finish': '18:00',
|
||||
|
|
|
|||
|
|
@ -137,6 +137,7 @@ def calculate_report_data(form: FormData, model: models.ExposureModel) -> typing
|
|||
er = np.array(model.concentration_model.infected.emission_rate_when_present()).mean()
|
||||
exposed_occupants = model.exposed.number
|
||||
expected_new_cases = np.array(model.expected_new_cases()).mean()
|
||||
uncertainties_plot_src = img2base64(_figure2bytes(uncertainties_plot(model))) if form.conditional_probability_plot else None
|
||||
|
||||
return {
|
||||
"model_repr": repr(model),
|
||||
|
|
@ -158,7 +159,7 @@ def calculate_report_data(form: FormData, model: models.ExposureModel) -> typing
|
|||
"emission_rate": er,
|
||||
"exposed_occupants": exposed_occupants,
|
||||
"expected_new_cases": expected_new_cases,
|
||||
"uncertainties_plot_scr": img2base64(_figure2bytes(uncertainties_plot([model])))
|
||||
"uncertainties_plot_src": uncertainties_plot_src,
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -406,6 +406,11 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-check">
|
||||
<input type="checkbox" id="conditional_probability_plot" class="tabbed form-check-input" name="conditional_probability_plot" value="1">
|
||||
<label for="conditional_probability_plot" class="form-check-label col-sm-12">Generate conditional probability of infection plot</label>
|
||||
</div>
|
||||
|
||||
<span id="training_limit_error" class="red_text" hidden>Conference/Training activities limited to 1 infected<br></span>
|
||||
|
||||
<hr width="80%">
|
||||
|
|
|
|||
|
|
@ -193,7 +193,9 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<img src= "{{ uncertainties_plot_scr }}" />
|
||||
{% if form.conditional_probability_plot %}
|
||||
<img src= "{{ uncertainties_plot_src }}" />
|
||||
{% endif %}
|
||||
|
||||
{% if form.short_range_option == "short_range_no" %}
|
||||
<div class="card bg-light mb-3">
|
||||
|
|
|
|||
Loading…
Reference in a new issue