From 61d76a8651c6e885300430dc59d197dfcd968004 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20Monta=C3=B1ana?= Date: Wed, 7 Jun 2023 13:54:36 +0200 Subject: [PATCH] Add dataset report --- .vscode/settings.json | 6 +++ app/app.db | Bin 28672 -> 28672 bytes app/results/main_select.py | 46 ++++++++++++++++++++++- app/results/templates/_table_report.html | 10 +++-- app/results/templates/best.html | 8 ++-- app/results/templates/dataset.html | 46 +++++++++++++++++++++++ app/results/templates/error.html | 3 +- app/results/templates/report.html | 13 +------ app/results/templates/report_tables.html | 17 +++++++++ app/results/templates/select.html | 14 +------ 10 files changed, 128 insertions(+), 35 deletions(-) create mode 100644 .vscode/settings.json create mode 100644 app/results/templates/dataset.html create mode 100644 app/results/templates/report_tables.html diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..d99f2f3 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,6 @@ +{ + "[python]": { + "editor.defaultFormatter": "ms-python.black-formatter" + }, + "python.formatting.provider": "none" +} \ No newline at end of file diff --git a/app/app.db b/app/app.db index b9e05e928d50d1f7d44d4faacf7f53df551659b0..cacd22d96bb9b1937c7ce3bc1973692d96eb601a 100644 GIT binary patch delta 56 zcmZp8z}WDBae_3X>O>i5M%9f83+=fX7#NuNUNP_&^1a$DDB#D(!e7WRVRM|HFe6JN M4") +@login_required +def dataset_report(dataset): + # Get info of the results obtained for a dataset + os.chdir(current_user.benchmark.folder) + app_config = dotenv_values(".env") + dt = Datasets() + data = dt.get_attributes(dataset) + names = Files.get_all_results(hidden=False) + results = {} + for name in names: + try: + with open(os.path.join(Folders.results, name)) as f: + data = json.load(f) + for result in data["results"]: + if dataset == result["dataset"]: + results[name] = result + except Exception as e: + return render_template( + "error.html", + message=f"Couldn't process file ({name})", + error=str(e), + back=url_for("results.dataset_report", dataset=dataset), + ) + return render_template( + "dataset.html", + dataset_name=dataset, + results=results, + app_config=app_config, + ) diff --git a/app/results/templates/_table_report.html b/app/results/templates/_table_report.html index 457cd25..6bd2d7c 100644 --- a/app/results/templates/_table_report.html +++ b/app/results/templates/_table_report.html @@ -4,9 +4,9 @@ {% endif %} @@ -85,7 +85,7 @@ data-field="time" data-sortable="true" data-sorter="remove_plus">Time - hyperparameters + Hyperparameters - {% endblock %} diff --git a/app/results/templates/report_tables.html b/app/results/templates/report_tables.html new file mode 100644 index 0000000..5d951bc --- /dev/null +++ b/app/results/templates/report_tables.html @@ -0,0 +1,17 @@ +{% extends "base.html" %} +{% block styles %} + {{ super() }} + + + +{% endblock %} +{% block content %}{% endblock %} +{% block jscript %} + {{ super() }} + + + +{% endblock %} diff --git a/app/results/templates/select.html b/app/results/templates/select.html index a8cef6c..c71fc24 100644 --- a/app/results/templates/select.html +++ b/app/results/templates/select.html @@ -1,21 +1,9 @@ -{% extends "base.html" %} -{% block styles %} - {{ super() }} - - - -{% endblock %} +{% extends "report_tables.html" %} {% block content %} {% include "_table_select.html" %} {% endblock %} {% block jscript %} {{ super() }} - - - {% endblock %}