From 3928b9c583c27131dcb440124a370f96a10993be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20Montan=CC=83ana?= Date: Sun, 28 May 2023 03:12:12 +0200 Subject: [PATCH] Change partials criteria --- benchmark/scripts/be_flask.py | 8 +- .../scripts/templates/base_bootstrap.html | 25 +++ benchmark/scripts/templates/base_bulma.html | 21 ++ .../scripts/templates/partials/js_select.html | 30 +++ .../partials/table_select_design.html | 11 ++ benchmark/scripts/templates/report.html | 187 ++++++++++++++++++ .../scripts/templates/report_bootstrap.html | 105 ---------- benchmark/scripts/templates/report_bulma.html | 110 ----------- benchmark/scripts/templates/select.html | 22 +++ .../scripts/templates/select_bootstrap.html | 69 ------- benchmark/scripts/templates/select_bulma.html | 63 ------ 11 files changed, 302 insertions(+), 349 deletions(-) create mode 100644 benchmark/scripts/templates/base_bootstrap.html create mode 100644 benchmark/scripts/templates/base_bulma.html create mode 100644 benchmark/scripts/templates/partials/js_select.html create mode 100644 benchmark/scripts/templates/partials/table_select_design.html create mode 100644 benchmark/scripts/templates/report.html delete mode 100644 benchmark/scripts/templates/report_bootstrap.html delete mode 100644 benchmark/scripts/templates/report_bulma.html create mode 100644 benchmark/scripts/templates/select.html delete mode 100644 benchmark/scripts/templates/select_bootstrap.html delete mode 100644 benchmark/scripts/templates/select_bulma.html diff --git a/benchmark/scripts/be_flask.py b/benchmark/scripts/be_flask.py index 0581b19..56ba6c9 100755 --- a/benchmark/scripts/be_flask.py +++ b/benchmark/scripts/be_flask.py @@ -39,9 +39,10 @@ def index(): candidate = app.config[FRAMEWORKS].copy() candidate.remove(app.config[FRAMEWORK]) return render_template( - f"select_{app.config[FRAMEWORK]}.html", + f"select.html", files=files, framework=candidate[0], + used_framework=app.config[FRAMEWORK], ) @@ -52,7 +53,10 @@ def show(): data = json.load(f) summary = process_data(selected_file, data) return render_template( - f"report_{app.config[FRAMEWORK]}.html", data=data, summary=summary + f"report.html", + data=data, + summary=summary, + used_framework=app.config[FRAMEWORK], ) diff --git a/benchmark/scripts/templates/base_bootstrap.html b/benchmark/scripts/templates/base_bootstrap.html new file mode 100644 index 0000000..cd6a841 --- /dev/null +++ b/benchmark/scripts/templates/base_bootstrap.html @@ -0,0 +1,25 @@ + + + + {{ title }} + + + + + + + {% block content %} + {% endblock %} + + + diff --git a/benchmark/scripts/templates/base_bulma.html b/benchmark/scripts/templates/base_bulma.html new file mode 100644 index 0000000..927ea63 --- /dev/null +++ b/benchmark/scripts/templates/base_bulma.html @@ -0,0 +1,21 @@ + + + + {{ title }} + + + + + + {% block content %} + {% endblock %} + + diff --git a/benchmark/scripts/templates/partials/js_select.html b/benchmark/scripts/templates/partials/js_select.html new file mode 100644 index 0000000..4a76c38 --- /dev/null +++ b/benchmark/scripts/templates/partials/js_select.html @@ -0,0 +1,30 @@ + \ No newline at end of file diff --git a/benchmark/scripts/templates/partials/table_select_design.html b/benchmark/scripts/templates/partials/table_select_design.html new file mode 100644 index 0000000..5c1589a --- /dev/null +++ b/benchmark/scripts/templates/partials/table_select_design.html @@ -0,0 +1,11 @@ +
+

Benchmark Results

+ + + {% include "partials/table_select.html" %} +
+ + + +{% include "partials/js_select.html" %} \ No newline at end of file diff --git a/benchmark/scripts/templates/report.html b/benchmark/scripts/templates/report.html new file mode 100644 index 0000000..82e7f5c --- /dev/null +++ b/benchmark/scripts/templates/report.html @@ -0,0 +1,187 @@ +{% set title = "Report Viewer" %} +{% if used_framework == "bootstrap" %} + {% extends "base_bootstrap.html" %} +{% else %} + {% extends "base_bulma.html" %} +{% endif%} +{% block content%} + {% if used_framework == "bootstrap" %} + {% set center = "text-center" %} + {% set right = "text-end" %} +
+
+
+
+ +

{{ data.title }}

+
+
+ + + + + + + + {% if data.duration > 7200 %} + {% set unit = "h" %} + {% set divider = 3600 %} + {% else %} + {% set unit = "min" %} + {% set divider = 60 %} + {% endif %} + + + + + + + + + + + + + + + + + + + + + + +
PlatformModelDateTimeDuration ({{ unit }})StratifiedDiscretized# Folds
{{ data.platform }}{{ data.model }} {{ data.version }}{{ data.date}}{{ data.time}}{{ "%.2f" % (data.duration/divider) }}{{ data.stratified }}{{ data.discretized }}{{ data.folds }}
Language{{ data.language }} {{ data.language_version }}Seeds{{ data.seeds }}
+ + + + + + + + + + + + + + + {% include "partials/table_report.html" %} + +
DatasetSamplesFeaturesClassesNodes{{data.score_name|capitalize}}Timehyperparameters
+ {% if summary|length > 0 %} +
+ + + + + + + + + {% include "partials/table_summary.html" %} +
SymbolMeaningCount
+
+ {% endif %} + + + Total score: {{ "%.6f" % (data.results | sum(attribute="score")) }} + +
+
+
+ {% else %} + {% set center = "has-text-centered" %} + {% set right = "has-text-right" %} +
+
+
+
+
+ +

{{ data.title }}

+
+
+
+
+
+
+
+ + + + + + + + {% if data.duration > 7200 %} + {% set unit = "h" %} + {% set divider = 3600 %} + {% else %} + {% set unit = "min" %} + {% set divider = 60 %} + {% endif %} + + + + + + + + + + + + + + + + + + + + + + +
PlatformModelDateTimeDuration ({{ unit }})StratifiedDiscretized# Folds
{{ data.platform }}{{ data.model }} {{ data.version }}{{ data.date}}{{ data.time}}{{ "%.2f" % (data.duration/divider) }}{{ data.stratified }}{{ data.discretized }}{{ data.folds }}
Language{{ data.language }} {{ data.language_version }}Seeds{{ data.seeds }}
+ + + + + + + + + + + + + + + {% include "partials/table_report.html" %} + +
DatasetSamplesFeaturesClassesNodes{{data.score_name|capitalize}}Timehyperparameters
+ {% if summary|length > 0 %} +
+ + + + + + + + + {% include "partials/table_summary.html" %} +
SymbolMeaningCount
+
+ {% endif %} +

+ + Total score: {{ "%.6f" % (data.results | sum(attribute="score")) }} +

+
+
+
+ {% endif %} +{% endblock %} diff --git a/benchmark/scripts/templates/report_bootstrap.html b/benchmark/scripts/templates/report_bootstrap.html deleted file mode 100644 index dcbedc9..0000000 --- a/benchmark/scripts/templates/report_bootstrap.html +++ /dev/null @@ -1,105 +0,0 @@ - - - - - - - - Report Viewer - - - - - {% set center = "text-center" %} - {% set right = "text-end" %} -
-
-
-
- -

{{ data.title }}

-
-
- - - - - - - - {% if data.duration > 7200 %} - {% set unit = "h" %} - {% set divider = 3600 %} - {% else %} - {% set unit = "min" %} - {% set divider = 60 %} - {% endif %} - - - - - - - - - - - - - - - - - - - - - - -
PlatformModelDateTimeDuration ({{ unit }})StratifiedDiscretized# Folds
{{ data.platform }}{{ data.model }} {{ data.version }}{{ data.date}}{{ data.time}}{{ "%.2f" % (data.duration/divider) }}{{ data.stratified }}{{ data.discretized }}{{ data.folds }}
Language{{ data.language }} {{ data.language_version }}Seeds{{ data.seeds }}
- - - - - - - - - - - - - - - {% include "partials/table_report.html" %} - -
DatasetSamplesFeaturesClassesNodes{{data.score_name|capitalize}}Timehyperparameters
- {% if summary|length > 0 %} -
- - - - - - - - - {% include "partials/table_summary.html" %} -
SymbolMeaningCount
-
- {% endif %} - - - Total score: {{ "%.6f" % (data.results | sum(attribute="score")) }} - -
-
-
- - - \ No newline at end of file diff --git a/benchmark/scripts/templates/report_bulma.html b/benchmark/scripts/templates/report_bulma.html deleted file mode 100644 index a2da25b..0000000 --- a/benchmark/scripts/templates/report_bulma.html +++ /dev/null @@ -1,110 +0,0 @@ - - - - - - - - Report Viewer - - - - - {% set center = "has-text-centered" %} - {% set right = "has-text-right" %} -
-
-
-
-
- -

{{ data.title }}

-
-
-
-
-
-
-
- - - - - - - - {% if data.duration > 7200 %} - {% set unit = "h" %} - {% set divider = 3600 %} - {% else %} - {% set unit = "min" %} - {% set divider = 60 %} - {% endif %} - - - - - - - - - - - - - - - - - - - - - - -
PlatformModelDateTimeDuration ({{ unit }})StratifiedDiscretized# Folds
{{ data.platform }}{{ data.model }} {{ data.version }}{{ data.date}}{{ data.time}}{{ "%.2f" % (data.duration/divider) }}{{ data.stratified }}{{ data.discretized }}{{ data.folds }}
Language{{ data.language }} {{ data.language_version }}Seeds{{ data.seeds }}
- - - - - - - - - - - - - - - {% include "partials/table_report.html" %} - -
DatasetSamplesFeaturesClassesNodes{{data.score_name|capitalize}}Timehyperparameters
- {% if summary|length > 0 %} -
- - - - - - - - - {% include "partials/table_summary.html" %} -
SymbolMeaningCount
-
- {% endif %} -

- - Total score: {{ "%.6f" % (data.results | sum(attribute="score")) }} -

-
-
-
- - - \ No newline at end of file diff --git a/benchmark/scripts/templates/select.html b/benchmark/scripts/templates/select.html new file mode 100644 index 0000000..7ab074c --- /dev/null +++ b/benchmark/scripts/templates/select.html @@ -0,0 +1,22 @@ +{% set title = "Benchmark Results" %} +{% if used_framework == "bootstrap" %} + {% extends "base_bootstrap.html" %} + {% set button_class = "btn btn-primary bt-sm" %} + {% set h1_class = "text-center" %} + {% set table_class = "table table-striped table-hover" %} + {% set button_pre = '' %} +{% else %} + {% extends "base_bulma.html" %} + {% set button_class = "button is-primary is-small" %} + {% set h1_class = "title is-1 has-text-centered" %} + {% set table_class = "table is-striped is-hoverable cell-border" %} + {% set button_pre = 'View' %} + {% set selected = "is-selected" %} +{% endif %} +{% block content %} + {% include "partials/table_select_design.html" %} +{% endblock %} diff --git a/benchmark/scripts/templates/select_bootstrap.html b/benchmark/scripts/templates/select_bootstrap.html deleted file mode 100644 index 1e2aba2..0000000 --- a/benchmark/scripts/templates/select_bootstrap.html +++ /dev/null @@ -1,69 +0,0 @@ - - - - - Benchmark - - - - - - - -
-

Benchmark Results

- - {% set table_class = "table table-striped table-hover" %} - {% set button_pre = '' %} - {% include "partials/table_select.html" %} -
- - - - - - - \ No newline at end of file diff --git a/benchmark/scripts/templates/select_bulma.html b/benchmark/scripts/templates/select_bulma.html deleted file mode 100644 index c306978..0000000 --- a/benchmark/scripts/templates/select_bulma.html +++ /dev/null @@ -1,63 +0,0 @@ - - - - - Benchmark Results - - - - - - -
-

Benchmark Results

- - {% set table_class = "table is-striped is-hoverable cell-border" %} - {% set button_pre = 'View' %} - {% include "partials/table_select.html" %} -
- - - - - - \ No newline at end of file