From 60086b3925b73af0ba0f4139b233de419aeef635 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20Monta=C3=B1ana?= Date: Mon, 29 May 2023 12:06:44 +0200 Subject: [PATCH] container-fluid and error tolerance in compare --- benchmark/scripts/be_flask.py | 5 +- .../partials/table_report_bootstrap.html | 2 +- .../partials/table_report_bulma.html | 4 +- .../templates/partials/table_select.html | 72 ++++++++++--------- .../partials/table_select_design.html | 2 +- benchmark/scripts/templates/select.html | 67 +++++++++-------- requirements.txt | 1 + 7 files changed, 80 insertions(+), 73 deletions(-) diff --git a/benchmark/scripts/be_flask.py b/benchmark/scripts/be_flask.py index fc639b7..ebed0fe 100755 --- a/benchmark/scripts/be_flask.py +++ b/benchmark/scripts/be_flask.py @@ -65,7 +65,10 @@ def show(): selected_file = request.form["selected-file"] with open(os.path.join(Folders.results, selected_file)) as f: data = json.load(f) - summary = process_data(selected_file, data) + try: + summary = process_data(selected_file, data) + except Exception as e: + return render_template("error.html", message=str(e)) return render_template( "report.html", data=data, diff --git a/benchmark/scripts/templates/partials/table_report_bootstrap.html b/benchmark/scripts/templates/partials/table_report_bootstrap.html index f88210d..12b6afb 100644 --- a/benchmark/scripts/templates/partials/table_report_bootstrap.html +++ b/benchmark/scripts/templates/partials/table_report_bootstrap.html @@ -1,6 +1,6 @@
-
+

{{ data.title }}

diff --git a/benchmark/scripts/templates/partials/table_report_bulma.html b/benchmark/scripts/templates/partials/table_report_bulma.html index 3b2c556..cd72099 100644 --- a/benchmark/scripts/templates/partials/table_report_bulma.html +++ b/benchmark/scripts/templates/partials/table_report_bulma.html @@ -1,6 +1,6 @@
-
+
@@ -10,7 +10,7 @@
-
+
diff --git a/benchmark/scripts/templates/partials/table_select.html b/benchmark/scripts/templates/partials/table_select.html index 5fbe858..0435f6f 100644 --- a/benchmark/scripts/templates/partials/table_select.html +++ b/benchmark/scripts/templates/partials/table_select.html @@ -1,35 +1,39 @@
- - - - - - - - - - - - - - - {% for file, data in files.items() %} - {% set parts = file.split('_') %} - {% set stratified = parts[6].split('.')[0] %} - - - - - - - - - - - - {% endfor %} - -
ModelMetricPlatformDateTimeStratifiedTitleScore
{{ parts[2] }}{{ parts[1] }}{{ parts[3] }}{{ parts[4] }}{{ parts[5] }}{{ 'True' if stratified =='1' else 'False' }}{{ "%s" % data["title"] }}{{ "%.6f" % data["score"] }} - {{ button_pre | safe }}{{ file }}{{ button_post | safe }} - -
\ No newline at end of file + + + Model + Metric + Platform + Date + Time + Stratified + Title + Score + + + + + {% for file, data in files.items() %} {% set parts = file.split('_') %} {% + set stratified = parts[6].split('.')[0] %} + + {{ parts[2] }} + {{ parts[1] }} + {{ parts[3] }} + {{ parts[4] }} + {{ parts[5] }} + {{ 'True' if stratified =='1' else 'False' }} + {{ "%s" % data["title"] }} + {{ "%.6f" % data["score"] }} + + {{ button_pre | safe }}{{ file }}{{ button_post | safe }} + + + + {% endfor %} + + diff --git a/benchmark/scripts/templates/partials/table_select_design.html b/benchmark/scripts/templates/partials/table_select_design.html index 6c01aae..70eb31f 100644 --- a/benchmark/scripts/templates/partials/table_select_design.html +++ b/benchmark/scripts/templates/partials/table_select_design.html @@ -1,4 +1,4 @@ -
+

Benchmark Results

diff --git a/benchmark/scripts/templates/select.html b/benchmark/scripts/templates/select.html index 6af6750..12cd42f 100644 --- a/benchmark/scripts/templates/select.html +++ b/benchmark/scripts/templates/select.html @@ -1,42 +1,41 @@ {% set title = "Benchmark Results" %} {% extends "base.html" %} {% if framework == "bootstrap" %} - {% set button_class = "btn btn-primary bt-sm" %} - {% set h1_class = "text-center" %} - {% set table_class = "table table-striped table-hover table-bordered" %} - {% set button_pre = '' %} - {% set selected = "selected" %} - {% set tag_class = "badge bg-primary bg-small" %} - {% set frbutton_position = "float-left" %} - {% set frtag_position = "float-right" %} - {% set level = "navbar" %} - "tag is-primary" - {% else %} - {% 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 is-bordered" %} - {% set button_pre = 'View' %} - {% set selected = "is-selected" %} - {% set tag_class = "tag is-primary is-normal" %} - {% set frbutton_position = "level-left" %} - {% set frtag_position = "level-right" %} - {% set level = "level" %} + {% set button_class = "btn btn-primary bt-sm" %} + {% set h1_class = "text-center" %} + {% set table_class = "table table-striped table-hover table-bordered" %} + {% set button_pre = '' %} + {% set selected = "selected" %} + {% set tag_class = "badge bg-primary bg-small" %} + {% set frbutton_position = "float-left" %} + {% set frtag_position = "float-right" %} + {% set level = "navbar" %} + {% set align_right = "text-end" %} + {% set container = "container-fluid" %} +{% else %} + {% 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 is-bordered" %} + {% set button_pre = 'View' %} + {% set selected = "is-selected" %} + {% set align_right = "text-end" %} + {% set container = "container is-fluid" %} {% endif %} {% block content %} - {% include "partials/table_select_design.html" %} + {% include "partials/table_select_design.html" %} {% endblock %} {% block jscript %} - - {% if framework == "bootstrap" %} - - {% endif %} - -{% endblock %} \ No newline at end of file + + {% if framework == "bootstrap" %} + + {% endif %} + +{% endblock %} diff --git a/requirements.txt b/requirements.txt index 32065e2..eb705fe 100644 --- a/requirements.txt +++ b/requirements.txt @@ -13,3 +13,4 @@ xgboost graphviz Wodt @ git+ssh://git@github.com/doctorado-ml/Wodt.git#egg=Wodt unittest-xml-reporting +flask