Skip to content

Commit

Permalink
JointByCond: Fix unique description
Browse files Browse the repository at this point in the history
  • Loading branch information
jschueller committed Oct 3, 2024
1 parent 3e7f2c7 commit a632806
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
2 changes: 1 addition & 1 deletion python/test/t_JointByConditioningDistribution_std.expout
Original file line number Diff line number Diff line change
Expand Up @@ -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 ]
Expand Down

0 comments on commit a632806

Please sign in to comment.