Skip to content

Commit

Permalink
chore(deps): revert dependency catch2 to v2 for 2024.4.0 (#2739)
Browse files Browse the repository at this point in the history
* Revert "Update dependency catch2 to v3.5.4 (#2703)"

* Revert "chore(deps): update dependency catch2 to v3 (#2205)"
  • Loading branch information
mvtiurin authored Apr 29, 2024
1 parent 1a31061 commit d89fbe9
Show file tree
Hide file tree
Showing 49 changed files with 456 additions and 397 deletions.
6 changes: 3 additions & 3 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,9 @@ onedal_repo(

http_archive(
name = "catch2",
url = "https://github.com/catchorg/Catch2/archive/v3.5.4.tar.gz",
sha256 = "b7754b711242c167d8f60b890695347f90a1ebc95949a045385114165d606dbb",
strip_prefix = "Catch2-3.5.4",
url = "https://github.com/catchorg/Catch2/archive/v2.13.10.tar.gz",
sha256 = "d54a712b7b1d7708bc7a819a8e6e47b2fde9536f487b89ccbca295072a7d9943",
strip_prefix = "Catch2-2.13.10",
)

http_archive(
Expand Down
48 changes: 24 additions & 24 deletions cpp/oneapi/dal/algo/covariance/test/fixture.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ class covariance_test : public te::crtp_algo_fixture<TestType, Derived> {
void general_checks(const te::dataframe& input, const te::table_id& input_table_id) {
const table data = input.get_table(this->get_policy(), input_table_id);

INFO("create descriptor cov cor means");
INFO("create descriptor cov cor means")
auto cov_desc =
covariance::descriptor<Float, Method, covariance::task::compute>().set_result_options(
covariance::result_options::cov_matrix | covariance::result_options::cor_matrix |
Expand All @@ -126,55 +126,55 @@ class covariance_test : public te::crtp_algo_fixture<TestType, Derived> {
auto compute_result = this->compute(cov_desc, data);
check_compute_result(cov_desc, data, compute_result);

INFO("create descriptor cov");
INFO("create descriptor cov")
cov_desc =
covariance::descriptor<Float, Method, covariance::task::compute>().set_result_options(
covariance::result_options::cov_matrix);
INFO("run compute optional: cov");
compute_result = this->compute(cov_desc, data);
check_compute_result(cov_desc, data, compute_result);

INFO("create descriptor cov biased");
INFO("create descriptor cov biased")
cov_desc = covariance::descriptor<Float, Method, covariance::task::compute>()
.set_result_options(covariance::result_options::cov_matrix)
.set_bias(true);
INFO("run compute optional: cov biased");
compute_result = this->compute(cov_desc, data);
check_compute_result(cov_desc, data, compute_result);

INFO("create descriptor cor");
INFO("create descriptor cor")
cov_desc =
covariance::descriptor<Float, Method, covariance::task::compute>().set_result_options(
covariance::result_options::cor_matrix);
INFO("run compute optional: cor");
compute_result = this->compute(cov_desc, data);
check_compute_result(cov_desc, data, compute_result);

INFO("create descriptor means");
INFO("create descriptor means")
cov_desc =
covariance::descriptor<Float, Method, covariance::task::compute>().set_result_options(
covariance::result_options::means);
INFO("run compute optional: means");
compute_result = this->compute(cov_desc, data);
check_compute_result(cov_desc, data, compute_result);

INFO("create descriptor cov cor");
INFO("create descriptor cov cor")
cov_desc =
covariance::descriptor<Float, Method, covariance::task::compute>().set_result_options(
covariance::result_options::cov_matrix | covariance::result_options::cor_matrix);
INFO("run compute optional: cov cor");
compute_result = this->compute(cov_desc, data);
check_compute_result(cov_desc, data, compute_result);

INFO("create descriptor cov means");
INFO("create descriptor cov means")
cov_desc =
covariance::descriptor<Float, Method, covariance::task::compute>().set_result_options(
covariance::result_options::cov_matrix | covariance::result_options::means);
INFO("run compute optional: cov means");
compute_result = this->compute(cov_desc, data);
check_compute_result(cov_desc, data, compute_result);

INFO("create descriptor cor means");
INFO("create descriptor cor means")
cov_desc =
covariance::descriptor<Float, Method, covariance::task::compute>().set_result_options(
covariance::result_options::cor_matrix | covariance::result_options::means);
Expand All @@ -187,7 +187,7 @@ class covariance_test : public te::crtp_algo_fixture<TestType, Derived> {
const te::table_id& input_table_id,
const std::int64_t nBlocks) {
const table data = input.get_table(this->get_policy(), input_table_id);
INFO("create descriptor cov cor means");
INFO("create descriptor cov cor means")
auto cov_desc =
covariance::descriptor<Float, Method, covariance::task::compute>().set_result_options(
covariance::result_options::cov_matrix | covariance::result_options::cor_matrix |
Expand All @@ -201,7 +201,7 @@ class covariance_test : public te::crtp_algo_fixture<TestType, Derived> {
auto compute_result = this->finalize_compute(cov_desc, partial_result);
check_compute_result(cov_desc, data, compute_result);

INFO("create descriptor cov");
INFO("create descriptor cov")
cov_desc =
covariance::descriptor<Float, Method, covariance::task::compute>().set_result_options(
covariance::result_options::cov_matrix);
Expand All @@ -214,7 +214,7 @@ class covariance_test : public te::crtp_algo_fixture<TestType, Derived> {
compute_result = this->finalize_compute(cov_desc, partial_result);
check_compute_result(cov_desc, data, compute_result);

INFO("create descriptor cor");
INFO("create descriptor cor")
cov_desc =
covariance::descriptor<Float, Method, covariance::task::compute>().set_result_options(
covariance::result_options::cor_matrix);
Expand All @@ -227,7 +227,7 @@ class covariance_test : public te::crtp_algo_fixture<TestType, Derived> {
compute_result = this->finalize_compute(cov_desc, partial_result);
check_compute_result(cov_desc, data, compute_result);

INFO("create descriptor means");
INFO("create descriptor means")
cov_desc =
covariance::descriptor<Float, Method, covariance::task::compute>().set_result_options(
covariance::result_options::means);
Expand All @@ -240,7 +240,7 @@ class covariance_test : public te::crtp_algo_fixture<TestType, Derived> {
compute_result = this->finalize_compute(cov_desc, partial_result);
check_compute_result(cov_desc, data, compute_result);

INFO("create descriptor cov cor");
INFO("create descriptor cov cor")
cov_desc =
covariance::descriptor<Float, Method, covariance::task::compute>().set_result_options(
covariance::result_options::cov_matrix | covariance::result_options::cor_matrix);
Expand All @@ -253,7 +253,7 @@ class covariance_test : public te::crtp_algo_fixture<TestType, Derived> {
compute_result = this->finalize_compute(cov_desc, partial_result);
check_compute_result(cov_desc, data, compute_result);

INFO("create descriptor cov means");
INFO("create descriptor cov means")
cov_desc =
covariance::descriptor<Float, Method, covariance::task::compute>().set_result_options(
covariance::result_options::cov_matrix | covariance::result_options::means);
Expand All @@ -266,7 +266,7 @@ class covariance_test : public te::crtp_algo_fixture<TestType, Derived> {
compute_result = this->finalize_compute(cov_desc, partial_result);
check_compute_result(cov_desc, data, compute_result);

INFO("create descriptor cor means");
INFO("create descriptor cor means")
cov_desc =
covariance::descriptor<Float, Method, covariance::task::compute>().set_result_options(
covariance::result_options::cor_matrix | covariance::result_options::means);
Expand All @@ -285,32 +285,32 @@ class covariance_test : public te::crtp_algo_fixture<TestType, Derived> {
const covariance::compute_result<>& result) {
if (result.get_result_options().test(result_options::cov_matrix)) {
const auto cov_matrix = result.get_cov_matrix();
INFO("check if cov matrix table shape is expected");
INFO("check if cov matrix table shape is expected")
REQUIRE(cov_matrix.get_row_count() == data.get_column_count());
REQUIRE(cov_matrix.get_column_count() == data.get_column_count());
INFO("check if there is no NaN in cov matrix table");
INFO("check if there is no NaN in cov matrix table")
REQUIRE(te::has_no_nans(cov_matrix));
INFO("check if cov matrix values are expected");
INFO("check if cov matrix values are expected")
check_cov_matrix_values(desc, data, cov_matrix);
}
if (result.get_result_options().test(result_options::cor_matrix)) {
const auto cor_matrix = result.get_cor_matrix();
INFO("check if cor matrix table shape is expected");
INFO("check if cor matrix table shape is expected")
REQUIRE(cor_matrix.get_row_count() == data.get_column_count());
REQUIRE(cor_matrix.get_column_count() == data.get_column_count());
INFO("check if there is no NaN in cor matrix table");
INFO("check if there is no NaN in cor matrix table")
REQUIRE(te::has_no_nans(cor_matrix));
INFO("check if cor matrix values are expected");
INFO("check if cor matrix values are expected")
check_cor_matrix_values(desc, data, cor_matrix);
}
if (result.get_result_options().test(result_options::means)) {
const auto means = result.get_means();
INFO("check if means table shape is expected");
INFO("check if means table shape is expected")
REQUIRE(means.get_row_count() == 1);
REQUIRE(means.get_column_count() == data.get_column_count());
INFO("check if there is no NaN in means table");
INFO("check if there is no NaN in means table")
REQUIRE(te::has_no_nans(means));
INFO("check if means values are expected");
INFO("check if means values are expected")
check_means_values(desc, data, means);
}
}
Expand Down
6 changes: 3 additions & 3 deletions cpp/oneapi/dal/algo/dbscan/test/fixture.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class dbscan_test : public te::crtp_algo_fixture<TestType, Derived> {
const table &ref_responses) {
CAPTURE(epsilon, min_observations);

INFO("create descriptor");
INFO("create descriptor")
const auto dbscan_desc = get_descriptor(epsilon, min_observations);

INFO("run compute");
Expand All @@ -119,7 +119,7 @@ class dbscan_test : public te::crtp_algo_fixture<TestType, Derived> {
std::int64_t min_observations,
float_t ref_dbi,
float_t dbi_ref_tol = 1.0e-4) {
INFO("create descriptor");
INFO("create descriptor")
const auto dbscan_desc = get_descriptor(epsilon, min_observations);

INFO("run compute");
Expand Down Expand Up @@ -151,7 +151,7 @@ class dbscan_test : public te::crtp_algo_fixture<TestType, Derived> {
std::int64_t min_observations) {
CAPTURE(epsilon, min_observations);

INFO("create descriptor");
INFO("create descriptor")
const auto dbscan_desc =
get_descriptor(epsilon, min_observations).set_result_options(compute_mode);

Expand Down
8 changes: 4 additions & 4 deletions cpp/oneapi/dal/algo/dbscan/test/spmd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,11 @@ class dbscan_spmd_test : public dbscan_test<TestType, dbscan_spmd_test<TestType>

const auto compute_result_batch =
oneapi::dal::test::engine::compute(this->get_policy(), dbscan_desc, data);
INFO("check references");
INFO("check references")
this->check_if_close(joined_result.get_core_flags(),
compute_result_batch.get_core_flags(),
"Cores");
INFO("check references");
INFO("check references")
this->check_if_close(joined_result.get_responses(),
compute_result_batch.get_responses(),
"responses");
Expand All @@ -133,15 +133,15 @@ class dbscan_spmd_test : public dbscan_test<TestType, dbscan_spmd_test<TestType>

auto joined_result = this->merge_compute_result(compute_results);

INFO("check references");
INFO("check references")
base_t::check_responses_against_ref(joined_result.get_responses(), ref_responses);
}
void run_spmd_dbi_checks(const table &data,
float_t epsilon,
std::int64_t min_observations,
float_t ref_dbi,
float_t dbi_ref_tol = 1.0e-4) {
INFO("create descriptor");
INFO("create descriptor")
const auto dbscan_desc =
dbscan::descriptor<float_t, method_t>(epsilon, min_observations)
.set_mem_save_mode(true)
Expand Down
22 changes: 11 additions & 11 deletions cpp/oneapi/dal/algo/decision_forest/test/fixture.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ class df_test : public te::crtp_algo_fixture<TestType, Derived> {
const auto infer_result = this->infer(desc, model, x_test);
check_infer_shapes(desc, data, infer_result);

INFO("check if infer accuracy is expected");
INFO("check if infer accuracy is expected")
for (auto ch : checker_list) {
CAPTURE(desc.get_features_per_node());
CAPTURE(desc.get_max_tree_depth());
Expand Down Expand Up @@ -287,29 +287,29 @@ class df_test : public te::crtp_algo_fixture<TestType, Derived> {
const df::train_result<Task>& result) {
constexpr bool is_cls = std::is_same_v<Task, decision_forest::task::classification>;

INFO("check if model shape is expected");
INFO("check if model shape is expected")
REQUIRE(result.get_model().get_tree_count() == desc.get_tree_count());
if constexpr (is_cls) {
REQUIRE(result.get_model().get_class_count() == desc.get_class_count());
}

if (check_mask_flag(desc.get_error_metric_mode(), error_metric_mode::out_of_bag_error)) {
INFO("check if oob error shape is expected");
INFO("check if oob error shape is expected")
REQUIRE(result.get_oob_err().has_data());
REQUIRE(result.get_oob_err().get_row_count() == 1);
REQUIRE(result.get_oob_err().get_column_count() == 1);
}

if (check_mask_flag(desc.get_error_metric_mode(),
error_metric_mode::out_of_bag_error_per_observation)) {
INFO("check if oob error per observation shape is expected");
INFO("check if oob error per observation shape is expected")
REQUIRE(result.get_oob_err_per_observation().has_data());
REQUIRE(result.get_oob_err_per_observation().get_row_count() == data.get_row_count());
REQUIRE(result.get_oob_err_per_observation().get_column_count() == 1);
}

if (variable_importance_mode::none != desc.get_variable_importance_mode()) {
INFO("check if variable improtance shape is expected");
INFO("check if variable improtance shape is expected")
REQUIRE(result.get_var_importance().has_data());
REQUIRE(result.get_var_importance().get_row_count() == 1);
REQUIRE(result.get_var_importance().get_column_count() == data.get_column_count() - 1);
Expand All @@ -322,21 +322,21 @@ class df_test : public te::crtp_algo_fixture<TestType, Derived> {
constexpr bool is_cls = std::is_same_v<Task, decision_forest::task::classification>;
if constexpr (is_cls) {
if (check_mask_flag(desc.get_infer_mode(), infer_mode::class_responses)) {
INFO("check if infer responses shape is expected");
INFO("check if infer responses shape is expected")
REQUIRE(result.get_responses().has_data());
REQUIRE(result.get_responses().get_row_count() == data.get_row_count());
REQUIRE(result.get_responses().get_column_count() == 1);
}

if (check_mask_flag(desc.get_infer_mode(), infer_mode::class_probabilities)) {
INFO("check if infer probabilities shape is expected");
INFO("check if infer probabilities shape is expected")
REQUIRE(result.get_probabilities().has_data());
REQUIRE(result.get_probabilities().get_row_count() == data.get_row_count());
REQUIRE(result.get_probabilities().get_column_count() == desc.get_class_count());
}
}
else {
INFO("check if infer responses shape is expected");
INFO("check if infer responses shape is expected")
REQUIRE(result.get_responses().has_data());
REQUIRE(result.get_responses().get_row_count() == data.get_row_count());
REQUIRE(result.get_responses().get_column_count() == 1);
Expand All @@ -349,7 +349,7 @@ class df_test : public te::crtp_algo_fixture<TestType, Derived> {
const te::table_id& data_table_id,
double accuracy_threshold) {
if (variable_importance_mode::none != desc.get_variable_importance_mode()) {
INFO("check if match of variable importance vs required one is expected");
INFO("check if match of variable importance vs required one is expected")
const auto required_var_imp = var_imp_data.get_table(data_table_id);
std::int64_t row_ind = 0;
switch (desc.get_variable_importance_mode()) {
Expand Down Expand Up @@ -377,7 +377,7 @@ class df_test : public te::crtp_algo_fixture<TestType, Derived> {
double required_oob_error,
double accuracy_threshold) {
if (check_mask_flag(desc.get_error_metric_mode(), error_metric_mode::out_of_bag_error)) {
INFO("check if match of oob error vs required one is expected");
INFO("check if match of oob error vs required one is expected")
const auto oob_err_val =
dal::row_accessor<const double>(train_result.get_oob_err()).pull();
if (required_oob_error > 0.0) {
Expand All @@ -393,7 +393,7 @@ class df_test : public te::crtp_algo_fixture<TestType, Derived> {
double accuracy_threshold) {
if (check_mask_flag(desc.get_error_metric_mode(),
error_metric_mode::out_of_bag_error_per_observation)) {
INFO("check if match of oob error vs cumulative oob error per observation is expected");
INFO("check if match of oob error vs cumulative oob error per observation is expected")
const auto oob_err_val =
dal::row_accessor<const double>(train_result.get_oob_err()).pull();
const auto oob_err_per_obs_arr =
Expand Down
2 changes: 1 addition & 1 deletion cpp/oneapi/dal/algo/decision_forest/test/serialization.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ class df_serialization_test : public te::float_algo_fixture<std::tuple_element_t

void compare_infer_results(const infer_result<task_t>& actual,
const infer_result<task_t>& reference) {
SECTION("compare responses") {
INFO("compare responses") {
te::check_if_tables_equal<float_t>(actual.get_responses(), reference.get_responses());
}
}
Expand Down
2 changes: 1 addition & 1 deletion cpp/oneapi/dal/algo/jaccard/test/jaccard_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ class jaccard_test {
const auto jaccard_coeffs_data = coeffs.get_data<float>();
int correct_coeff_count = 0;
for (std::int64_t i = 0; i < nonzero_coeff_count; i++) {
if (Catch::Approx(jaccard_coeffs_data[i]) == correct_jaccard_coeffs[i])
if (Approx(jaccard_coeffs_data[i]) == correct_jaccard_coeffs[i])
correct_coeff_count++;
}
REQUIRE(correct_coeff_count == nonzero_coeff_count);
Expand Down
Loading

0 comments on commit d89fbe9

Please sign in to comment.