@@ -294,14 +294,13 @@ def bisection_spread(self, x_start: float, x_end:float, modelling_date:date, end
294294class CorpBondPortfolio ():
295295 def __init__ (self , corporate_bonds : dict [int ,CorpBond ] = None ):
296296 """
297- Initialize the EquitySharePortfolio instance with the first EquityShare instance
297+ Initialize the CorpBondPortfolio instance with the first CorpBond instance
298298
299299 Parameters
300300 ----------
301301 :type corporate_bonds: dict[int,CorpBond]
302302 """
303-
304- #logger.info("CorpBondPortfolio initializer called")
303+
305304 self .corporate_bonds = corporate_bonds
306305
307306 def IsEmpty (self )-> bool :
@@ -323,20 +322,20 @@ def add(self,corp_bond: CorpBond) :
323322
324323 def create_aggregate_coupon_dates (self , modelling_date )-> dict :
325324 """
326- Create the vector of dates at which the coupons are paid out and the total amounts for
327- all corporate bonds in the portfolio, for dates on or after the modelling date
325+ Create the vector of dates at which the coupons are paid out and the total amounts for
326+ all corporate bonds in the portfolio, for dates on or after the modelling date
328327
329- Parameters
330- ----------
331- self : CorpBondPortfolio class instance
332- The CorpBondPortfolio instance with populated initial portfolio.
328+ Parameters
329+ ----------
330+ self : CorpBondPortfolio class instance
331+ The CorpBondPortfolio instance with populated initial portfolio.
333332
334- Returns
335- -------
336- CorporateBond.coupondates
337- An array of datetimes, containing all the dates at which the coupons are paid out.
333+ Returns
334+ -------
335+ CorporateBond.coupondates
336+ An array of datetimes, containing all the dates at which the coupons are paid out.
338337
339- """
338+ """
340339
341340 coupons : dict [date , float ] = {}
342341 corp_bond : CorpBond
@@ -418,18 +417,16 @@ def unique_dates_profile(self, cash_flow_profile: list):
418417
419418 Parameters
420419 ----------
421- self: EquitySharePortfolio class instance
422- The EquitySharePortfolio instance with populated portfolio.
420+ self: CorpBondPortfolio class instance
421+ The CorpBondPortfolio instance with populated portfolio.
423422 :type cashflow_profile: list of dictionaries containing the size and date of each
424- cash-flow for the equity portfolio
423+ cash-flow for the corporate bond portfolio
425424
426-
427- :rtype dict list with two elements:
428- unique_dates
429- cash_flow_matrix
425+ Returns
426+ -------
427+ :rtype list: list of sorted unique dates containing at least one cash flow
430428 """
431429
432- # define list of unique dates
433430 unique_dates = []
434431 for one_dividend_array in cash_flow_profile .values ():
435432 for one_dividend_date in list (one_dividend_array .keys ()): # for each dividend date of the selected equity
0 commit comments