Fix back button in manage

Fix sort datasets in b_main when --datasets is used
This commit is contained in:
2025-02-19 13:32:07 +01:00
parent c1531dba2a
commit f48864a415
3 changed files with 17 additions and 15 deletions

View File

@@ -178,6 +178,11 @@ namespace platform {
}
}
filesToTest = file_names;
sort(filesToTest.begin(), filesToTest.end(), [](const auto& lhs, const auto& rhs) {
const auto result = mismatch(lhs.cbegin(), lhs.cend(), rhs.cbegin(), rhs.cend(), [](const auto& lhs, const auto& rhs) {return tolower(lhs) == tolower(rhs);});
return result.second != rhs.cend() && (result.first == lhs.cend() || tolower(*result.first) < tolower(*result.second));
});
saveResults = true;
if (title == "") {
title = "Test " + to_string(file_names.size()) + " datasets " + model_name + " " + to_string(n_folds) + " folds";

View File

@@ -82,8 +82,6 @@ namespace platform {
std::cout << Colors::RESET() << std::endl;
}
int num = 0;
// Sort files to test to have a consistent order even if --datasets is used
std::stable_sort(filesToTest.begin(), filesToTest.end());
for (auto fileName : filesToTest) {
if (!quiet)
std::cout << " " << setw(3) << right << num++ << " " << setw(max_name) << left << fileName << right << flush;