@@ -35,8 +35,8 @@ def __init__(
3535 ):
3636 """
3737 Creates a discount curve using a vector of times and ON fwd rates
38- The fwd rate is right-continuous i.e. a given value in the
39- input is applied to the left of that date until the previous date exclusive
38+ The fwd rate is right-continuous i.e. a given value in the input
39+ is applied to the left of that date until the previous date exclusive
4040 The last fwd rate is extrapolated into the future
4141 """
4242
@@ -77,7 +77,7 @@ def __init__(
7777 if test_monotonicity (self ._times ) is False :
7878 raise FinError ("Times are not sorted in increasing order" )
7979
80- ###############################################################################
80+ ###########################################################################
8181
8282 @classmethod
8383 def brick_wall_curve (
@@ -87,13 +87,17 @@ def brick_wall_curve(
8787 end_dt : Date ,
8888 level : float = 1.0 * G_BASIS_POINT ,
8989 ):
90- """Generate a discount curve of the shape f(t) = level*1_{startdate < t <= enddate} where f(.) is the instantaneous forward rate
91- Mostly useful for applying bumps to other discount_curve's, see composite_discount_curve.py
90+ """Generate a discount curve of the shape
91+ f(t) = level*1_{startdate < t <= enddate}
92+ where f(.) is the instantaneous forward rate
93+ Mostly useful for applying bumps to other discount_curve's,
94+ see composite_discount_curve.py
9295 Args:
9396 valuation_date (Date): valuation date for the discount_curve
9497 start_dt (Date): start of the non-zero ON forward rate
9598 end_dt (Date): end of the non-zero ON forward rate
96- level (float, optional): ON forward rate between the start and end dates. Defaults to 1.0*G_BASIS_POINT.
99+ level (float, optional): ON forward rate between the
100+ start and end dates. Defaults to 1.0*G_BASIS_POINT.
97101
98102 Returns:
99103 DiscountCurve: discount curve of the required shape
@@ -102,7 +106,7 @@ def brick_wall_curve(
102106 onfwd_rates = [0.0 , level , 0.0 ]
103107 return cls (valuation_date , knot_dts , onfwd_rates )
104108
105- ###############################################################################
109+ ###########################################################################
106110
107111 @classmethod
108112 def flat_curve (
@@ -112,7 +116,7 @@ def flat_curve(
112116 onfwd_rates = [level ]
113117 return cls (valuation_date , knot_dts , onfwd_rates )
114118
115- ###############################################################################
119+ ###########################################################################
116120
117121 def _zero_rate (self , times : Union [float , np .ndarray , list ]):
118122 """
@@ -129,11 +133,11 @@ def _zero_rate(self, times: Union[float, np.ndarray, list]):
129133 zero_rates = - ldfs / times
130134 return zero_rates
131135
132- ###############################################################################
136+ ###########################################################################
133137
134138 def df_t (self , t : Union [float , np .ndarray ]):
135- """Return discount factors given a single or vector of times in years. The
136- discount factor depends on the rate and this in turn depends on its
139+ """Return discount factors given a single or vector of times in years.
140+ The discount factor depends on the rate and this in turn depends on its
137141 compounding frequency and it defaults to continuous compounding. It
138142 also depends on the day count convention. This was set in the
139143 construction of the curve to be ACT_ACT_ISDA."""
@@ -146,7 +150,7 @@ def df_t(self, t: Union[float, np.ndarray]):
146150
147151 return df
148152
149- ###############################################################################
153+ ###########################################################################
150154
151155 def __repr__ (self ):
152156
@@ -157,7 +161,7 @@ def __repr__(self):
157161 s += label_to_string ("FREQUENCY" , (self .freq_type ))
158162 return s
159163
160- ###############################################################################
164+ ###########################################################################
161165
162166 def _print (self ):
163167 """Simple print function for backward compatibility."""
0 commit comments