Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion python/rateslib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ def __exit__(self, *args) -> None: # type: ignore[no-untyped-def]
"ProxyCurve",
"index_left",
"index_value",
# # fixings.py cannot load due to circular import
# # analytic_fixings.py cannot load due to circular import
# "FXFixing",
# "IBORFixing",
# "IBORStubFixing",
Expand Down
53 changes: 53 additions & 0 deletions python/rateslib/curves/_parsers.py
Original file line number Diff line number Diff line change
Expand Up @@ -390,3 +390,56 @@ def _to_six_curve_dict(
disc2=curves,
index2=NoInput(0),
)


class _Curves:
"""
Container for a pricing object providing a mapping for curves.
"""

def __init__(
self,
*,
rate_curve: CurveOption_ = NoInput(0),
disc_curve: CurveOption_ = NoInput(0),
index_curve: CurveOption_ = NoInput(0),
leg2_rate_curve: CurveOption_ = NoInput(0),
leg2_disc_curve: CurveOption_ = NoInput(0),
leg2_index_curve: CurveOption_ = NoInput(0),
):
self._rate_curve = rate_curve
self._disc_curve = disc_curve
self._index_curve = index_curve
self._leg2_rate_curve = leg2_rate_curve
self._leg2_disc_curve = leg2_disc_curve
self._leg2_index_curve = leg2_index_curve

@property
def rate_curve(self) -> CurveOption_:
"""The curve used for floating rate or hazard rate forecasting on leg1."""
return self._rate_curve

@property
def disc_curve(self) -> CurveOption_:
"""The curve used for discounting on leg1."""
return self._disc_curve

@property
def index_curve(self) -> CurveOption_:
"""The index curve used for forecasting index values on leg1."""
return self._index_curve

@property
def leg2_rate_curve(self) -> CurveOption_:
"""The curve used for floating rate or hazard rate forecasting on leg2."""
return self._leg2_rate_curve

@property
def leg2_disc_curve(self) -> CurveOption_:
"""The curve used for discounting on leg2."""
return self._leg2_disc_curve

@property
def leg2_index_curve(self) -> CurveOption_:
"""The index curve used for forecasting index values on leg2."""
return self._leg2_index_curve
7 changes: 7 additions & 0 deletions python/rateslib/instruments/components/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from rateslib.instruments.components.cds import CDS
from rateslib.instruments.components.irs import IRS

__all__ = [
"IRS",
"CDS",
]
Loading
Loading