Commit 0b1a9cd6 authored by Thibault Hallouin's avatar Thibault Hallouin
Browse files

skip ranks-based metrics in conditional masking tests

because of the random process in the rank computations, and the
different input tensor sizes
Showing with 45 additions and 3 deletions
+45 -3
......@@ -606,10 +606,24 @@ TEST(ProbabilistTests, TestMaskingConditions)
// check results are identical
for (std::size_t m = 0; m < all_metrics_p.size(); m++)
{
// ---------------------------------------------------------------------
// /!\ skip ranks-based metrics because it contains a random process
// for which setting the seed will not work because the time series
// lengths are different between "conditioned" and "preconditioned",
// which results in different tensor shapes, and hence in different
// random ranks for ties
if ((all_metrics_p[m] == "RANK_DIAG")
|| (all_metrics_p[m] == "DS")
|| (all_metrics_p[m] == "AS"))
{
continue;
}
// ---------------------------------------------------------------------
EXPECT_TRUE(
xt::all(xt::isclose(metrics_q_conditioned[m],
metrics_q_preconditioned[m],
1e-05, 1e-06, true))
1e-05, 1e-08, true))
) << "Failure for (" << all_metrics_p[m] << ")";
}
......@@ -647,10 +661,24 @@ TEST(ProbabilistTests, TestMaskingConditions)
// check results are identical
for (std::size_t m = 0; m < all_metrics_p.size(); m++)
{
// ---------------------------------------------------------------------
// /!\ skip ranks-based metrics because it contains a random process
// for which setting the seed will not work because the time series
// lengths are different between "conditioned" and "preconditioned",
// which results in different tensor shapes, and hence in different
// random ranks for ties
if ((all_metrics_p[m] == "RANK_DIAG")
|| (all_metrics_p[m] == "DS")
|| (all_metrics_p[m] == "AS"))
{
continue;
}
// ---------------------------------------------------------------------
EXPECT_TRUE(
xt::all(xt::isclose(metrics_q_conditioned_[m],
metrics_q_preconditioned_[m],
1e-05, 1e-06, true))
1e-05, 1e-08, true))
) << "Failure for (" << all_metrics_p[m] << ")";
}
......@@ -685,10 +713,24 @@ TEST(ProbabilistTests, TestMaskingConditions)
// check results are identical
for (std::size_t m = 0; m < all_metrics_p.size(); m++)
{
// ---------------------------------------------------------------------
// /!\ skip ranks-based metrics because it contains a random process
// for which setting the seed will not work because the time series
// lengths are different between "conditioned" and "subset",
// which results in different tensor shapes, and hence in different
// random ranks for ties
if ((all_metrics_p[m] == "RANK_DIAG")
|| (all_metrics_p[m] == "DS")
|| (all_metrics_p[m] == "AS"))
{
continue;
}
// ---------------------------------------------------------------------
EXPECT_TRUE(
xt::all(xt::isclose(metrics_t_conditioned[m],
metrics_t_subset[m],
1e-05, 1e-06, true))
1e-05, 1e-08, true))
) << "Failure for (" << all_metrics_p[m] << ")";
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment