Fix back button in manage
Fix sort datasets in b_main when --datasets is used
This commit is contained in:
@@ -178,6 +178,11 @@ namespace platform {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
filesToTest = file_names;
|
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;
|
saveResults = true;
|
||||||
if (title == "") {
|
if (title == "") {
|
||||||
title = "Test " + to_string(file_names.size()) + " datasets " + model_name + " " + to_string(n_folds) + " folds";
|
title = "Test " + to_string(file_names.size()) + " datasets " + model_name + " " + to_string(n_folds) + " folds";
|
||||||
|
@@ -82,8 +82,6 @@ namespace platform {
|
|||||||
std::cout << Colors::RESET() << std::endl;
|
std::cout << Colors::RESET() << std::endl;
|
||||||
}
|
}
|
||||||
int num = 0;
|
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) {
|
for (auto fileName : filesToTest) {
|
||||||
if (!quiet)
|
if (!quiet)
|
||||||
std::cout << " " << setw(3) << right << num++ << " " << setw(max_name) << left << fileName << right << flush;
|
std::cout << " " << setw(3) << right << num++ << " " << setw(max_name) << left << fileName << right << flush;
|
||||||
|
@@ -487,20 +487,19 @@ namespace platform {
|
|||||||
index_A = index;
|
index_A = index;
|
||||||
list("A set to " + std::to_string(index), Colors::GREEN());
|
list("A set to " + std::to_string(index), Colors::GREEN());
|
||||||
break;
|
break;
|
||||||
case 'B': // set_b or back to list
|
case 'B': // set_b
|
||||||
if (output_type == OutputType::EXPERIMENTS) {
|
if (index == index_A) {
|
||||||
if (index == index_A) {
|
list("A and B cannot be the same!", Colors::RED());
|
||||||
list("A and B cannot be the same!", Colors::RED());
|
break;
|
||||||
break;
|
|
||||||
}
|
|
||||||
index_B = index;
|
|
||||||
list("B set to " + std::to_string(index), Colors::GREEN());
|
|
||||||
} else {
|
|
||||||
// back to show the report
|
|
||||||
output_type = OutputType::RESULT;
|
|
||||||
paginator[static_cast<int>(OutputType::DETAIL)].setPage(1);
|
|
||||||
list(STATUS_OK, STATUS_COLOR);
|
|
||||||
}
|
}
|
||||||
|
index_B = index;
|
||||||
|
list("B set to " + std::to_string(index), Colors::GREEN());
|
||||||
|
break;
|
||||||
|
case 'b': // back to list
|
||||||
|
// back to show the report
|
||||||
|
output_type = OutputType::RESULT;
|
||||||
|
paginator[static_cast<int>(OutputType::DETAIL)].setPage(1);
|
||||||
|
list(STATUS_OK, STATUS_COLOR);
|
||||||
break;
|
break;
|
||||||
case 'c':
|
case 'c':
|
||||||
if (index_A == -1 || index_B == -1) {
|
if (index_A == -1 || index_B == -1) {
|
||||||
|
Reference in New Issue
Block a user