From c8431e56b2e77c702ee3d28854ae0a14951ffddf Mon Sep 17 00:00:00 2001 From: Luis Aleixo Date: Fri, 25 Mar 2022 11:10:57 +0100 Subject: [PATCH 1/3] warning scale at cern image rename --- cara/apps/templates/cern/calculator.report.html.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cara/apps/templates/cern/calculator.report.html.j2 b/cara/apps/templates/cern/calculator.report.html.j2 index 126143d2..4d8c5d90 100644 --- a/cara/apps/templates/cern/calculator.report.html.j2 +++ b/cara/apps/templates/cern/calculator.report.html.j2 @@ -134,7 +134,7 @@ -
+

From 9ef38329d101d85a8391abf0f9c9bd8ab168407c Mon Sep 17 00:00:00 2001 From: Luis Aleixo Date: Thu, 24 Mar 2022 12:19:35 +0100 Subject: [PATCH 2/3] Added Disclaimer to common text --- cara/apps/calculator/__init__.py | 7 +++- .../templates/base/calculator.form.html.j2 | 35 +----------------- cara/apps/templates/base/userguide.html.j2 | 36 +----------------- cara/apps/templates/common_text.md.j2 | 37 +++++++++++++++++++ 4 files changed, 45 insertions(+), 70 deletions(-) diff --git a/cara/apps/calculator/__init__.py b/cara/apps/calculator/__init__.py index b9572896..17189304 100644 --- a/cara/apps/calculator/__init__.py +++ b/cara/apps/calculator/__init__.py @@ -140,6 +140,7 @@ class StaticModel(BaseRequestHandler): executor_factory=functools.partial( concurrent.futures.ThreadPoolExecutor, self.settings['report_generation_parallelism'], + self.settings["template_environment"].globals['common_text'], ), ) report: str = await asyncio.wrap_future(report_task) @@ -154,7 +155,7 @@ class LandingPage(BaseRequestHandler): report = template.render( user=self.current_user, calculator_prefix=self.settings["calculator_prefix"], - text_blocks=template_environment.globals['common_text'] + text_blocks=template_environment.globals['common_text'], ) self.finish(report) @@ -174,6 +175,7 @@ class AboutPage(BaseRequestHandler): class CalculatorForm(BaseRequestHandler): def get(self): + template_environment = self.settings["template_environment"] template = self.settings["template_environment"].get_template( "calculator.form.html.j2") report = template.render( @@ -181,6 +183,7 @@ class CalculatorForm(BaseRequestHandler): xsrf_form_html=self.xsrf_form_html(), calculator_prefix=self.settings["calculator_prefix"], calculator_version=__version__, + text_blocks=template_environment.globals['common_text'], ) self.finish(report) @@ -199,11 +202,13 @@ class CompressedCalculatorFormInputs(BaseRequestHandler): class ReadmeHandler(BaseRequestHandler): def get(self): + template_environment = self.settings["template_environment"] template = self.settings['template_environment'].get_template("userguide.html.j2") readme = template.render( active_page="calculator/user-guide", user=self.current_user, calculator_prefix=self.settings["calculator_prefix"], + text_blocks=template_environment.globals['common_text'], ) self.finish(readme) diff --git a/cara/apps/templates/base/calculator.form.html.j2 b/cara/apps/templates/base/calculator.form.html.j2 index 03986daa..a9403ec1 100644 --- a/cara/apps/templates/base/calculator.form.html.j2 +++ b/cara/apps/templates/base/calculator.form.html.j2 @@ -574,40 +574,7 @@
-
-

- CARA is a risk assessment tool developed to model the concentration of viruses in enclosed spaces, in order to inform space-management decisions. -

-

- CARA models the concentration profile of virions in enclosed spaces with clear and intuitive graphs. - The user can set a number of parameters, including room volume, exposure time, activity type, mask-wearing and ventilation. - The report generated indicates how to avoid exceeding critical concentrations and chains of airborne transmission in spaces such as individual offices, meeting rooms and labs. -

-

- The risk assessment tool simulates the long-range airborne spread SARS-CoV-2 virus in a finite volume, assuming a homogenous mixture, and estimates the risk of COVID-19 airborne transmission therein. - The results DO NOT include short-range airborne exposure (where the physical distance is a significant factor) nor the other known modes of SARS-CoV-2 transmission. - Hence, the output from this model is only valid when the other recommended public health & safety instructions are observed, such as adequate physical distancing, good hand hygiene and other barrier measures. -

-

- The model used is based on scientific publications relating to airborne transmission of infectious diseases, dose-response exposures and aerosol science, as of February 2021. - It can be used to compare the effectiveness of different airborne-related risk mitigation measures. -

-

- Note that this model applies a deterministic approach, i.e., it is assumed at least one person is infected and shedding viruses into the simulated volume. - Nonetheless, it is also important to understand that the absolute risk of infection is uncertain, as it will depend on the probability that someone infected attends the event. - The model is most useful for comparing the impact and effectiveness of different mitigation measures such as ventilation, filtration, exposure time, physical activity and - the size of the room, only considering long-range airborne transmission of COVID-19 in indoor settings. -

-

- This tool is designed to be informative, allowing the user to adapt different settings and model the relative impact on the estimated infection probabilities. - The objective is to facilitate targeted decision-making and investment through comparisons, rather than a singular determination of absolute risk. - While the SARS-CoV-2 virus is in circulation among the population, the notion of 'zero risk' or 'completely safe scenario' does not exist. - Each event modelled is unique, and the results generated therein are only as accurate as the inputs and assumptions. -

-

- CARA has not undergone review, approval or certification by competent authorities, and as a result, it cannot be considered - as a fully endorsed and reliable tool, namely in the assessment of potential viral emissions from infected hosts to be modelled. -

+ {# {{ text_blocks['Disclaimer'] }} #}
diff --git a/cara/apps/templates/base/userguide.html.j2 b/cara/apps/templates/base/userguide.html.j2 index 8685fbc0..97cad39b 100644 --- a/cara/apps/templates/base/userguide.html.j2 +++ b/cara/apps/templates/base/userguide.html.j2 @@ -17,41 +17,7 @@
-
-

- CARA is a risk assessment tool developed to model the concentration of viruses in enclosed spaces, in order to inform space-management decisions. -

-

- CARA models the concentration profile of potential virions in enclosed spaces with clear and intuitive graphs. - The user can set a number of parameters, including room volume, exposure time, activity type, mask-wearing and ventilation. - The report generated indicates how to avoid exceeding critical concentrations and chains of airborne transmission in spaces such as individual offices, meeting rooms and labs. -

-

- The risk assessment tool simulates the long-range airborne spread SARS-CoV-2 virus in a finite volume, assuming a homogenous mixture, and estimates the risk of COVID-19 airborne transmission therein. - The results DO NOT include short-range airborne exposure (where the physical distance is a significant factor) nor the other known modes of SARS-CoV-2 transmission. - Hence, the output from this model is only valid when the other recommended public health & safety instructions are observed, such as adequate physical distancing, good hand hygiene and other barrier measures. -

-

- The model used is based on scientific publications relating to airborne transmission of infectious diseases, dose-response exposures and aerosol science, as of February 2021. - It can be used to compare the effectiveness of different airborne-related risk mitigation measures. -

-

- Note that this model applies a deterministic approach, i.e., it is assumed at least one person is infected and shedding viruses into the simulated volume. - Nonetheless, it is also important to understand that the absolute risk of infection is uncertain, as it will depend on the probability that someone infected attends the event. - The model is most useful for comparing the impact and effectiveness of different mitigation measures such as ventilation, filtration, exposure time, physical activity and - the size of the room, only considering long-range airborne transmission of COVID-19 in indoor settings. -

-

- This tool is designed to be informative, allowing the user to adapt different settings and model the relative impact on the estimated infection probabilities. - The objective is to facilitate targeted decision-making and investment through comparisons, rather than a singular determination of absolute risk. - While the SARS-CoV-2 virus is in circulation among the population, the notion of 'zero risk' or 'completely safe scenario' does not exist. - Each event modelled is unique, and the results generated therein are only as accurate as the inputs and assumptions. -

-

- CARA has not undergone review, approval or certification by competent authorities, and as a result, it cannot be considered - as a fully endorsed and reliable tool, namely in the assessment of potential viral emissions from infected hosts to be modelled. -

-
+ {{ text_blocks['Disclaimer'] }}
diff --git a/cara/apps/templates/common_text.md.j2 b/cara/apps/templates/common_text.md.j2 index 5eebb32d..5bb03ae1 100644 --- a/cara/apps/templates/common_text.md.j2 +++ b/cara/apps/templates/common_text.md.j2 @@ -22,6 +22,43 @@ We wish to thank CERN’s HSE Unit, Beams Department, Experimental Physics Department, Information Technology Department, Industry, Procurement and Knowledge Transfer Department and International Relations Sector for their support to the study. Thanks to Doris Forkel-Wirth, Benoit Delille, Walid Fadel, Olga Beltramello, Letizia Di Giulio, Evelyne Dho, Wayne Salter, Benoit Salvant and colleagues from the COVID working group for providing expert advice and extensively testing the model. Finally, we wish to thank Fabienne Landua and the design service for preparing the illustrations and Alessandro Raimondo and Manuela Cirilli from the Knowledge Transfer Group for their continuous support. Our compliments towards the work and research performed by world leading scientists in this domain: Dr. Julian Tang, Prof. Manuel Gameiro, Dr. Linsey Marr, Prof. Lidia Morawska, Prof. Yuguo Li, and others – their scientific contribution was indispensable for this project. +## Disclaimer +
+

+ CARA is a risk assessment tool developed to model the concentration of viruses in enclosed spaces, in order to inform space-management decisions. +

+

+ CARA models the concentration profile of virions in enclosed spaces with clear and intuitive graphs. + The user can set a number of parameters, including room volume, exposure time, activity type, mask-wearing and ventilation. + The report generated indicates how to avoid exceeding critical concentrations and chains of airborne transmission in spaces such as individual offices, meeting rooms and labs. +

+

+ The risk assessment tool simulates the long-range airborne spread SARS-CoV-2 virus in a finite volume, assuming a homogenous mixture, and estimates the risk of COVID-19 airborne transmission therein. + The results DO NOT include short-range airborne exposure (where the physical distance is a significant factor) nor the other known modes of SARS-CoV-2 transmission. + Hence, the output from this model is only valid when the other recommended public health & safety instructions are observed, such as adequate physical distancing, good hand hygiene and other barrier measures. +

+

+ The model used is based on scientific publications relating to airborne transmission of infectious diseases, dose-response exposures and aerosol science, as of February 2021. + It can be used to compare the effectiveness of different airborne-related risk mitigation measures. +

+

+ Note that this model applies a deterministic approach, i.e., it is assumed at least one person is infected and shedding viruses into the simulated volume. + Nonetheless, it is also important to understand that the absolute risk of infection is uncertain, as it will depend on the probability that someone infected attends the event. + The model is most useful for comparing the impact and effectiveness of different mitigation measures such as ventilation, filtration, exposure time, physical activity and + the size of the room, only considering long-range airborne transmission of COVID-19 in indoor settings. +

+

+ This tool is designed to be informative, allowing the user to adapt different settings and model the relative impact on the estimated infection probabilities. + The objective is to facilitate targeted decision-making and investment through comparisons, rather than a singular determination of absolute risk. + While the SARS-CoV-2 virus is in circulation among the population, the notion of 'zero risk' or 'completely safe scenario' does not exist. + Each event modelled is unique, and the results generated therein are only as accurate as the inputs and assumptions. +

+

+ CARA has not undergone review, approval or certification by competent authorities, and as a result, it cannot be considered + as a fully endorsed and reliable tool, namely in the assessment of potential viral emissions from infected hosts to be modelled. +

+
+ ## References Reference list can be found in the CARA paper: CERN-OPEN-2021-004 From dc1020c15938edd0eab749b9bda86884e8be1f69 Mon Sep 17 00:00:00 2001 From: Luis Aleixo Date: Thu, 24 Mar 2022 14:54:12 +0100 Subject: [PATCH 3/3] Added disclaimer from common_text in report page --- cara/apps/calculator/__init__.py | 7 +- cara/apps/calculator/report_generator.py | 6 +- .../templates/base/calculator.form.html.j2 | 2 +- .../templates/base/calculator.report.html.j2 | 38 +---------- cara/apps/templates/base/userguide.html.j2 | 2 +- cara/apps/templates/common_text.md.j2 | 68 +++++++++---------- 6 files changed, 45 insertions(+), 78 deletions(-) diff --git a/cara/apps/calculator/__init__.py b/cara/apps/calculator/__init__.py index 17189304..e396ea8c 100644 --- a/cara/apps/calculator/__init__.py +++ b/cara/apps/calculator/__init__.py @@ -140,7 +140,6 @@ class StaticModel(BaseRequestHandler): executor_factory=functools.partial( concurrent.futures.ThreadPoolExecutor, self.settings['report_generation_parallelism'], - self.settings["template_environment"].globals['common_text'], ), ) report: str = await asyncio.wrap_future(report_task) @@ -150,7 +149,7 @@ class StaticModel(BaseRequestHandler): class LandingPage(BaseRequestHandler): def get(self): template_environment = self.settings["template_environment"] - template = self.settings["template_environment"].get_template( + template = template_environment.get_template( "index.html.j2") report = template.render( user=self.current_user, @@ -176,7 +175,7 @@ class AboutPage(BaseRequestHandler): class CalculatorForm(BaseRequestHandler): def get(self): template_environment = self.settings["template_environment"] - template = self.settings["template_environment"].get_template( + template = template_environment.get_template( "calculator.form.html.j2") report = template.render( user=self.current_user, @@ -203,7 +202,7 @@ class CompressedCalculatorFormInputs(BaseRequestHandler): class ReadmeHandler(BaseRequestHandler): def get(self): template_environment = self.settings["template_environment"] - template = self.settings['template_environment'].get_template("userguide.html.j2") + template = template_environment.get_template("userguide.html.j2") readme = template.render( active_page="calculator/user-guide", user=self.current_user, diff --git a/cara/apps/calculator/report_generator.py b/cara/apps/calculator/report_generator.py index 1bbf967d..c06b63ee 100644 --- a/cara/apps/calculator/report_generator.py +++ b/cara/apps/calculator/report_generator.py @@ -12,6 +12,7 @@ import jinja2 import numpy as np from cara import models +from cara.apps.calculator import markdown_tools from ... import monte_carlo as mc from .model_generator import FormData, _DEFAULT_MC_SAMPLE_SIZE from ... import dataclass_utils @@ -315,6 +316,9 @@ class ReportGenerator: loader=self.jinja_loader, undefined=jinja2.StrictUndefined, ) + env.globals['common_text'] = markdown_tools.extract_rendered_markdown_blocks( + env.get_template('common_text.md.j2') + ) env.filters['non_zero_percentage'] = non_zero_percentage env.filters['readable_minutes'] = readable_minutes env.filters['minutes_to_time'] = minutes_to_time @@ -325,4 +329,4 @@ class ReportGenerator: def render(self, context: dict) -> str: template = self._template_environment().get_template("calculator.report.html.j2") - return template.render(**context) + return template.render(**context, text_blocks=template.globals['common_text']) diff --git a/cara/apps/templates/base/calculator.form.html.j2 b/cara/apps/templates/base/calculator.form.html.j2 index a9403ec1..84b3e987 100644 --- a/cara/apps/templates/base/calculator.form.html.j2 +++ b/cara/apps/templates/base/calculator.form.html.j2 @@ -574,7 +574,7 @@
- {# {{ text_blocks['Disclaimer'] }} #} +
{{ text_blocks['Disclaimer'] }}
diff --git a/cara/apps/templates/base/calculator.report.html.j2 b/cara/apps/templates/base/calculator.report.html.j2 index db6f2436..52d8ad6c 100644 --- a/cara/apps/templates/base/calculator.report.html.j2 +++ b/cara/apps/templates/base/calculator.report.html.j2 @@ -410,42 +410,8 @@


{% block disclaimer %} -

Disclaimer:

- -

- CARA is a risk assessment tool developed to model the concentration of viruses in enclosed spaces, in order to inform space-management decisions. -

-

- CARA models the concentration profile of potential infectious viruses in enclosed spaces with clear and intuitive graphs. - The user can set a number of parameters, including room volume, exposure time, activity type, mask-wearing and ventilation. - The report generated indicates how to avoid exceeding critical concentrations and chains of airborne transmission in spaces such as individual offices, meeting rooms and labs. -

-

- The risk assessment tool simulates the long-range airborne spread SARS-CoV-2 virus in a finite volume, assuming a homogenous mixture, and estimates the risk of COVID-19 airborne transmission therein. - The results DO NOT include short-range airborne exposure (where the physical distance is a significant factor) nor the other known modes of SARS-CoV-2 transmission. - Hence, the output from this model is only valid when the other recommended public health & safety instructions are observed, such as adequate physical distancing, good hand hygiene and other barrier measures. -

-

- The model used is based on scientific publications relating to airborne transmission of infectious diseases, dose-response exposures and aerosol science, as of February 2021. - It can be used to compare the effectiveness of different airborne-related risk mitigation measures. -

-

- Note that this model applies a deterministic approach, i.e., it is assumed at least one person is infected and shedding viruses into the simulated volume. - Nonetheless, it is also important to understand that the absolute risk of infection is uncertain, as it will depend on the probability that someone infected attends the event. - The model is most useful for comparing the impact and effectiveness of different mitigation measures such as ventilation, filtration, exposure time, physical activity and - the size of the room, only considering long-range airborne transmission of COVID-19 in indoor settings. -

-

- This tool is designed to be informative, allowing the user to adapt different settings and model the relative impact on the estimated infection probabilities. - The objective is to facilitate targeted decision-making and investment through comparisons, rather than a singular determination of absolute risk. - While the SARS-CoV-2 virus is in circulation among the population, the notion of 'zero risk' or 'completely safe scenario' does not exist. - Each event modelled is unique, and the results generated therein are only as accurate as the inputs and assumptions. -

-

- CARA has not undergone review, approval or certification by competent authorities, and as a result, it cannot be considered - as a fully endorsed and reliable tool, namely in the assessment of potential viral emissions from infected hosts to be modelled. -

- +

Disclaimer:

+ {{ text_blocks['Disclaimer'] }} {% endblock disclaimer %}
{% endblock disclaimer_container %} diff --git a/cara/apps/templates/base/userguide.html.j2 b/cara/apps/templates/base/userguide.html.j2 index 97cad39b..893637c2 100644 --- a/cara/apps/templates/base/userguide.html.j2 +++ b/cara/apps/templates/base/userguide.html.j2 @@ -17,7 +17,7 @@
- {{ text_blocks['Disclaimer'] }} +
{{ text_blocks['Disclaimer'] }}
diff --git a/cara/apps/templates/common_text.md.j2 b/cara/apps/templates/common_text.md.j2 index 5bb03ae1..795c07b5 100644 --- a/cara/apps/templates/common_text.md.j2 +++ b/cara/apps/templates/common_text.md.j2 @@ -23,41 +23,39 @@ We wish to thank CERN’s HSE Unit, Beams Department, Experimental Physics Department, Information Technology Department, Industry, Procurement and Knowledge Transfer Department and International Relations Sector for their support to the study. Thanks to Doris Forkel-Wirth, Benoit Delille, Walid Fadel, Olga Beltramello, Letizia Di Giulio, Evelyne Dho, Wayne Salter, Benoit Salvant and colleagues from the COVID working group for providing expert advice and extensively testing the model. Finally, we wish to thank Fabienne Landua and the design service for preparing the illustrations and Alessandro Raimondo and Manuela Cirilli from the Knowledge Transfer Group for their continuous support. Our compliments towards the work and research performed by world leading scientists in this domain: Dr. Julian Tang, Prof. Manuel Gameiro, Dr. Linsey Marr, Prof. Lidia Morawska, Prof. Yuguo Li, and others – their scientific contribution was indispensable for this project. ## Disclaimer -
-

- CARA is a risk assessment tool developed to model the concentration of viruses in enclosed spaces, in order to inform space-management decisions. -

-

- CARA models the concentration profile of virions in enclosed spaces with clear and intuitive graphs. - The user can set a number of parameters, including room volume, exposure time, activity type, mask-wearing and ventilation. - The report generated indicates how to avoid exceeding critical concentrations and chains of airborne transmission in spaces such as individual offices, meeting rooms and labs. -

-

- The risk assessment tool simulates the long-range airborne spread SARS-CoV-2 virus in a finite volume, assuming a homogenous mixture, and estimates the risk of COVID-19 airborne transmission therein. - The results DO NOT include short-range airborne exposure (where the physical distance is a significant factor) nor the other known modes of SARS-CoV-2 transmission. - Hence, the output from this model is only valid when the other recommended public health & safety instructions are observed, such as adequate physical distancing, good hand hygiene and other barrier measures. -

-

- The model used is based on scientific publications relating to airborne transmission of infectious diseases, dose-response exposures and aerosol science, as of February 2021. - It can be used to compare the effectiveness of different airborne-related risk mitigation measures. -

-

- Note that this model applies a deterministic approach, i.e., it is assumed at least one person is infected and shedding viruses into the simulated volume. - Nonetheless, it is also important to understand that the absolute risk of infection is uncertain, as it will depend on the probability that someone infected attends the event. - The model is most useful for comparing the impact and effectiveness of different mitigation measures such as ventilation, filtration, exposure time, physical activity and - the size of the room, only considering long-range airborne transmission of COVID-19 in indoor settings. -

-

- This tool is designed to be informative, allowing the user to adapt different settings and model the relative impact on the estimated infection probabilities. - The objective is to facilitate targeted decision-making and investment through comparisons, rather than a singular determination of absolute risk. - While the SARS-CoV-2 virus is in circulation among the population, the notion of 'zero risk' or 'completely safe scenario' does not exist. - Each event modelled is unique, and the results generated therein are only as accurate as the inputs and assumptions. -

-

- CARA has not undergone review, approval or certification by competent authorities, and as a result, it cannot be considered - as a fully endorsed and reliable tool, namely in the assessment of potential viral emissions from infected hosts to be modelled. -

-
+

+ CARA is a risk assessment tool developed to model the concentration of viruses in enclosed spaces, in order to inform space-management decisions. +

+

+ CARA models the concentration profile of virions in enclosed spaces with clear and intuitive graphs. + The user can set a number of parameters, including room volume, exposure time, activity type, mask-wearing and ventilation. + The report generated indicates how to avoid exceeding critical concentrations and chains of airborne transmission in spaces such as individual offices, meeting rooms and labs. +

+

+ The risk assessment tool simulates the long-range airborne spread SARS-CoV-2 virus in a finite volume, assuming a homogenous mixture, and estimates the risk of COVID-19 airborne transmission therein. + The results DO NOT include short-range airborne exposure (where the physical distance is a significant factor) nor the other known modes of SARS-CoV-2 transmission. + Hence, the output from this model is only valid when the other recommended public health & safety instructions are observed, such as adequate physical distancing, good hand hygiene and other barrier measures. +

+

+ The model used is based on scientific publications relating to airborne transmission of infectious diseases, dose-response exposures and aerosol science, as of February 2021. + It can be used to compare the effectiveness of different airborne-related risk mitigation measures. +

+

+ Note that this model applies a deterministic approach, i.e., it is assumed at least one person is infected and shedding viruses into the simulated volume. + Nonetheless, it is also important to understand that the absolute risk of infection is uncertain, as it will depend on the probability that someone infected attends the event. + The model is most useful for comparing the impact and effectiveness of different mitigation measures such as ventilation, filtration, exposure time, physical activity and + the size of the room, only considering long-range airborne transmission of COVID-19 in indoor settings. +

+

+ This tool is designed to be informative, allowing the user to adapt different settings and model the relative impact on the estimated infection probabilities. + The objective is to facilitate targeted decision-making and investment through comparisons, rather than a singular determination of absolute risk. + While the SARS-CoV-2 virus is in circulation among the population, the notion of 'zero risk' or 'completely safe scenario' does not exist. + Each event modelled is unique, and the results generated therein are only as accurate as the inputs and assumptions. +

+

+ CARA has not undergone review, approval or certification by competent authorities, and as a result, it cannot be considered + as a fully endorsed and reliable tool, namely in the assessment of potential viral emissions from infected hosts to be modelled. +

## References