Skip to content

Commit b9e1eab

Browse files
author
Shen
committed
QPR-13600: Add StructuredMessage when whole segment is removed
1 parent 8e6e91c commit b9e1eab

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

OREData/ored/marketdata/yieldcurve.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1403,6 +1403,8 @@ void YieldCurve::buildBootstrappedCurve(const std::set<std::size_t>& indices) {
14031403
DLOG("checking overlap of segments and remove instruments");
14041404

14051405
for (Size i = 0; i < curveSegments_[index].size(); ++i) {
1406+
Size initialSize = instrumentsPerSegment[i].size();
1407+
14061408
if (i < curveSegments_[index].size() - 1 &&
14071409
curveSegments_[index][i]->priority() > curveSegments_[index][i + 1]->priority()) {
14081410
DLOG("checking overlap between segment #"
@@ -1441,6 +1443,15 @@ void YieldCurve::buildBootstrappedCurve(const std::set<std::size_t>& indices) {
14411443
++it;
14421444
}
14431445
}
1446+
1447+
// Check if whole segment has been removed
1448+
if (initialSize > 0 && instrumentsPerSegment[i].empty()) {
1449+
std::map<std::string, std::string> subFields;
1450+
subFields["curveId"] = curveSpec_[index]->name();
1451+
subFields["segmentType"] = curveSegments_[index][i]->typeID();
1452+
StructuredMessage(StructuredMessage::Category::Warning, StructuredMessage::Group::Configuration,
1453+
"Entire yield curve segment has been removed", subFields).log();
1454+
}
14441455
}
14451456

14461457
/* Set mixed interpolation size using the specified cutoff for the number of segments */

0 commit comments

Comments
 (0)