yield_curve_model
Classes:
YieldCurve
YieldCurve(parent=None)
Bases: QAbstractTableModel
Methods:
-
get_yield_data
–Given a date, return the yield data for various maturities.
-
update_yield_data
–Update the yield data and notify the view that the data has changed.
get_yield_data
get_yield_data(query_date: date) -> list[tuple[str, float]]
Given a date, return the yield data for various maturities.
:param query_date: The date for which to fetch the yield data. :return: A list of tuples containing (maturity, yield).
update_yield_data
update_yield_data(
new_yield_data: dict[date, list[tuple[str, float]]],
) -> None
Update the yield data and notify the view that the data has changed.
An example key-value pair of the new_yield_data
dict is:
date(2023, 1, 1): [("1M", 0.5), ("2M", 0.55), ...]
:param new_yield_data: The new yield data to update. :type new_yield_data: dict