container-fluid and error tolerance in compare

This commit is contained in:
2023-05-29 12:06:44 +02:00
parent c55a0b29ab
commit 60086b3925
7 changed files with 80 additions and 73 deletions

View File

@@ -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,

View File

@@ -1,6 +1,6 @@
<div id="app">
<section class="section">
<div class="container">
<div class="container-fluid">
<div class="p-4 bg-primary text-white">
<button type="button" class="btn-close" aria-label="Close" onclick="location.href='/index';"></button>
<h1>{{ data.title }}</h1>

View File

@@ -1,6 +1,6 @@
<div id="app">
<header>
<div class="container">
<div class="container is-fluid">
<div class="hero is-info is-bold">
<div class="hero-body">
<button class="delete is-large" onclick="location.href='/index';"></button>
@@ -10,7 +10,7 @@
</div>
</header>
<section class="section">
<div class="container">
<div class="container is-fluid">
<div>
<table class="table is-fullwidth is-striped is-bordered">
<thead>

View File

@@ -1,35 +1,39 @@
<table id="file-table" class="{{ table_class }}">
<thead>
<tr>
<th>Model</th>
<th>Metric</th>
<th>Platform</th>
<th>Date</th>
<th>Time</th>
<th>Stratified</th>
<th>Title</th>
<th>Score</th>
<th></th>
</tr>
</thead>
<tbody>
{% for file, data in files.items() %}
{% set parts = file.split('_') %}
{% set stratified = parts[6].split('.')[0] %}
<tr>
<td>{{ parts[2] }}</td>
<td>{{ parts[1] }}</td>
<td>{{ parts[3] }}</td>
<td>{{ parts[4] }}</td>
<td>{{ parts[5] }}</td>
<td>{{ 'True' if stratified =='1' else 'False' }}</td>
<td>{{ "%s" % data["title"] }}</td>
<td>{{ "%.6f" % data["score"] }}</td>
<td>
{{ button_pre | safe }}{{ file }}{{ button_post | safe }}
<input type="checkbox" class="{{ checkbox_class }}" name="selected_files" value="{{ file }}">
</td>
</tr>
{% endfor %}
</tbody>
</table>
<thead>
<tr>
<th>Model</th>
<th>Metric</th>
<th>Platform</th>
<th>Date</th>
<th>Time</th>
<th>Stratified</th>
<th>Title</th>
<th>Score</th>
<th></th>
</tr>
</thead>
<tbody>
{% for file, data in files.items() %} {% set parts = file.split('_') %} {%
set stratified = parts[6].split('.')[0] %}
<tr>
<td>{{ parts[2] }}</td>
<td>{{ parts[1] }}</td>
<td>{{ parts[3] }}</td>
<td>{{ parts[4] }}</td>
<td>{{ parts[5] }}</td>
<td>{{ 'True' if stratified =='1' else 'False' }}</td>
<td>{{ "%s" % data["title"] }}</td>
<td class="{{ align_right }}">{{ "%.6f" % data["score"] }}</td>
<td>
{{ button_pre | safe }}{{ file }}{{ button_post | safe }}
<input
type="checkbox"
class="{{ checkbox_class }}"
name="selected_files"
value="{{ file }}"
/>
</td>
</tr>
{% endfor %}
</tbody>
</table>

View File

@@ -1,4 +1,4 @@
<div class="container">
<div class="{{ container }}">
<h1 class="{{ h1_class }}"><b>Benchmark Results</b></h1>
<div class="{{ level }}">
<div class="{{ frbutton_position }}">

View File

@@ -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 = '<button class="btn btn-primary btn-sm"
style="--bs-btn-padding-y: .25rem; --bs-btn-padding-x: .5rem; --bs-btn-font-size: .75rem;"
onclick="showFile(\''%}
{% set button_post = '\')">View</button>' %}
{% 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 = '<span class="tag is-link is-normal" type="button" onclick="showFile(\'' %}
{% set button_post = '\')">View</span>' %}
{% 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 = '<button class="btn btn-primary btn-sm"
style="--bs-btn-padding-y: .25rem; --bs-btn-padding-x: .5rem; --bs-btn-font-size: .75rem;"
onclick="showFile(\''%}
{% set button_post = '\')">View</button>' %}
{% 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 = '<span class="tag is-link is-normal" type="button" onclick="showFile(\'' %}
{% set button_post = '\')">View</span>' %}
{% 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 %}
<script src="https://cdn.datatables.net/1.10.25/js/jquery.dataTables.min.js"></script>
{% if framework == "bootstrap" %}
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/js/bootstrap.min.js" integrity="sha384-cuYeSxntonz0PPNlHhBs68uyIAVpIIOZZ5JqeqvYYIcEL727kskC66kF92t6Xl2V"
crossorigin="anonymous"></script>
{% endif %}
<script>
{% include "partials/js_select.js" %}
</script>
{% endblock %}
<script src="https://cdn.datatables.net/1.10.25/js/jquery.dataTables.min.js"></script>
{% if framework == "bootstrap" %}
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/js/bootstrap.min.js" integrity="sha384-cuYeSxntonz0PPNlHhBs68uyIAVpIIOZZ5JqeqvYYIcEL727kskC66kF92t6Xl2V"
crossorigin="anonymous"></script>
{% endif %}
<script>
{% include "partials/js_select.js" %}
</script>
{% endblock %}

View File

@@ -13,3 +13,4 @@ xgboost
graphviz
Wodt @ git+ssh://git@github.com/doctorado-ml/Wodt.git#egg=Wodt
unittest-xml-reporting
flask