From 3eb890d1a234880993f86872d1276872f3e0bd11 Mon Sep 17 00:00:00 2001 From: Luis Aleixo Date: Fri, 3 Jun 2022 11:52:36 +0200 Subject: [PATCH 1/3] Added code repr to input data --- cara/apps/calculator/report_generator.py | 1 + cara/apps/templates/base/calculator.report.html.j2 | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/cara/apps/calculator/report_generator.py b/cara/apps/calculator/report_generator.py index 5731e6cb..7a4b428f 100644 --- a/cara/apps/calculator/report_generator.py +++ b/cara/apps/calculator/report_generator.py @@ -136,6 +136,7 @@ def calculate_report_data(form: FormData, model: models.ExposureModel) -> typing expected_new_cases = np.array(model.expected_new_cases()).mean() return { + "model_repr": repr(model), "times": list(times), "exposed_presence_intervals": [list(interval) for interval in model.exposed.presence.boundaries()], "short_range_intervals": short_range_intervals, diff --git a/cara/apps/templates/base/calculator.report.html.j2 b/cara/apps/templates/base/calculator.report.html.j2 index bfe9632f..4e4e6006 100644 --- a/cara/apps/templates/base/calculator.report.html.j2 +++ b/cara/apps/templates/base/calculator.report.html.j2 @@ -474,6 +474,14 @@
{% endblock simulation_overview %} +
+
+
+ {{ model_repr }} +
+
{% block report_preamble %} {% endblock report_preamble %} From 07a9f9c60e0474b9fcd2218835ad6cfcd6c92585 Mon Sep 17 00:00:00 2001 From: Luis Aleixo Date: Tue, 7 Jun 2022 16:23:49 +0200 Subject: [PATCH 2/3] Changed code representation block to be HTML comment --- cara/apps/templates/base/calculator.report.html.j2 | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/cara/apps/templates/base/calculator.report.html.j2 b/cara/apps/templates/base/calculator.report.html.j2 index 4e4e6006..fdc783b7 100644 --- a/cara/apps/templates/base/calculator.report.html.j2 +++ b/cara/apps/templates/base/calculator.report.html.j2 @@ -16,6 +16,10 @@ + + {% block report_header %}
@@ -473,15 +477,7 @@

- {% endblock simulation_overview %} -
-
-
- {{ model_repr }} -
-
+ {% endblock simulation_overview %} {% block report_preamble %} {% endblock report_preamble %} From 668920da9b033cec789a3f39e5decf750ccb0c4c Mon Sep 17 00:00:00 2001 From: Luis Aleixo Date: Mon, 4 Jul 2022 16:12:08 +0200 Subject: [PATCH 3/3] Added note to model representation --- cara/apps/templates/base/calculator.report.html.j2 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cara/apps/templates/base/calculator.report.html.j2 b/cara/apps/templates/base/calculator.report.html.j2 index fdc783b7..c6ca579a 100644 --- a/cara/apps/templates/base/calculator.report.html.j2 +++ b/cara/apps/templates/base/calculator.report.html.j2 @@ -16,8 +16,10 @@ - {% block report_header %} @@ -477,7 +479,7 @@
- {% endblock simulation_overview %} + {% endblock simulation_overview %} {% block report_preamble %} {% endblock report_preamble %}