From a6328062ff2269d41d4e8c86d8479857d4440d94 Mon Sep 17 00:00:00 2001 From: Julien Schueller Date: Thu, 3 Oct 2024 16:06:16 +0200 Subject: [PATCH] JointByCond: Fix unique description --- .../Distribution/JointByConditioningDistribution.cxx | 6 ++++-- python/test/t_JointByConditioningDistribution_std.expout | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/src/Uncertainty/Distribution/JointByConditioningDistribution.cxx b/lib/src/Uncertainty/Distribution/JointByConditioningDistribution.cxx index 1ffe0a3c7d..6b840c4b86 100644 --- a/lib/src/Uncertainty/Distribution/JointByConditioningDistribution.cxx +++ b/lib/src/Uncertainty/Distribution/JointByConditioningDistribution.cxx @@ -288,13 +288,15 @@ void JointByConditioningDistribution::setConditionedAndConditioningDistributions Description description(conditioningDistribution.getDescription()); description.add(conditionedDistribution.getDescription()); + // avoid description warning with identical entries - Description::const_iterator it = std::unique(description.begin(), description.end()); - if (it != description.end()) + std::sort(description.begin(), description.end()); + if (std::unique(description.begin(), description.end()) != description.end()) { description = Description::BuildDefault(conditioningDistribution.getDimension(), "Y"); description.add(Description::BuildDefault(conditionedDistribution.getDimension(), "X")); } + setDescription(description); } diff --git a/python/test/t_JointByConditioningDistribution_std.expout b/python/test/t_JointByConditioningDistribution_std.expout index 192beec476..9bc990119c 100644 --- a/python/test/t_JointByConditioningDistribution_std.expout +++ b/python/test/t_JointByConditioningDistribution_std.expout @@ -5,7 +5,7 @@ Elliptical distribution= False Elliptical copula= False Independent copula= False oneRealization= [0.629877,1.88281,-1.75408] -oneSample= [ X0 X1 X2 ] +oneSample= [ Y0 Y1 X0 ] 0 : [ 0.347057 1.96942 2.72115 ] 1 : [ 0.0632061 1.29276 0.515725 ] 2 : [ 0.373767 1.73727 2.87065 ]