diff --git a/src/Platform/BestResultsExcel.cc b/src/Platform/BestResultsExcel.cc index 34291c9..45751ad 100644 --- a/src/Platform/BestResultsExcel.cc +++ b/src/Platform/BestResultsExcel.cc @@ -75,7 +75,7 @@ namespace platform { writeString(row, 4, "Hyperparameters", "bodyHeader"); auto i = 0; string hyperparameters; - int hypSize = 0; + int hypSize = 22; map files; // map of files imported and their tabs for (auto const& item : data.items()) { row++; diff --git a/src/Platform/ManageResults.cc b/src/Platform/ManageResults.cc index 5bca520..37f262b 100644 --- a/src/Platform/ManageResults.cc +++ b/src/Platform/ManageResults.cc @@ -22,6 +22,10 @@ namespace platform { } void ManageResults::doMenu() { + if (results.empty()) { + cout << Colors::MAGENTA() << "No results found!" << Colors::RESET() << endl; + return; + } results.sortDate(); list(); menu(); @@ -32,10 +36,6 @@ namespace platform { } void ManageResults::list() { - if (results.empty()) { - cout << Colors::MAGENTA() << "No results found!" << Colors::RESET() << endl; - exit(0); - } auto temp = ConfigLocale(); string suffix = numFiles != results.size() ? " of " + to_string(results.size()) : ""; stringstream oss; diff --git a/src/Platform/Results.cc b/src/Platform/Results.cc index 79a45d3..b551b98 100644 --- a/src/Platform/Results.cc +++ b/src/Platform/Results.cc @@ -1,12 +1,17 @@ #include "Results.h" #include +#include namespace platform { Results::Results(const string& path, const string& model, const string& score, bool complete, bool partial) : path(path), model(model), scoreName(score), complete(complete), partial(partial) { load(); - maxModel = (*max_element(files.begin(), files.end(), [](const Result& a, const Result& b) { return a.getModel().size() < b.getModel().size(); })).getModel().size(); + if (!files.empty()) { + maxModel = (*max_element(files.begin(), files.end(), [](const Result& a, const Result& b) { return a.getModel().size() < b.getModel().size(); })).getModel().size(); + } else { + maxModel = 0; + } }; void Results::load() {