1010from scipy .interpolate import CubicSpline
1111from scipy .interpolate import InterpolatedUnivariateSpline
1212from ...utils .error import FinError
13- from ...utils .global_vars import g_small
13+ from ...utils .global_vars import G_SMALL
1414from ...utils .tension_spline import TensionSpline
1515
1616###############################################################################
@@ -236,8 +236,8 @@ def fit(self, times: np.ndarray, dfs: np.ndarray):
236236
237237 elif self ._interp_type == InterpTypes .PCHIP_ZERO_RATES :
238238
239- g_small_vector = np .ones (len (self ._times )) * g_small
240- zero_rates = - np .log (self ._dfs ) / (self ._times + g_small_vector )
239+ G_SMALL_vector = np .ones (len (self ._times )) * G_SMALL
240+ zero_rates = - np .log (self ._dfs ) / (self ._times + G_SMALL_vector )
241241
242242 if self ._times [0 ] == 0.0 :
243243 zero_rates [0 ] = zero_rates [1 ]
@@ -256,8 +256,8 @@ def fit(self, times: np.ndarray, dfs: np.ndarray):
256256
257257 """Second derivatives at left is zero and first derivative at
258258 right is clamped to zero."""
259- g_small_vector = np .ones (len (self ._times )) * g_small
260- zero_rates = - np .log (self ._dfs ) / (self ._times + g_small_vector )
259+ G_SMALL_vector = np .ones (len (self ._times )) * G_SMALL
260+ zero_rates = - np .log (self ._dfs ) / (self ._times + G_SMALL_vector )
261261
262262 if self ._times [0 ] == 0.0 :
263263 zero_rates [0 ] = zero_rates [1 ]
@@ -275,8 +275,8 @@ def fit(self, times: np.ndarray, dfs: np.ndarray):
275275 elif self ._interp_type == InterpTypes .NATCUBIC_ZERO_RATES :
276276
277277 """Second derivatives are clamped to zero at end points"""
278- g_small_vector = np .ones (len (self ._times )) * g_small
279- zero_rates = - np .log (self ._dfs ) / (self ._times + g_small_vector )
278+ G_SMALL_vector = np .ones (len (self ._times )) * G_SMALL
279+ zero_rates = - np .log (self ._dfs ) / (self ._times + G_SMALL_vector )
280280
281281 if self ._times [0 ] == 0.0 :
282282 zero_rates [0 ] = zero_rates [1 ]
@@ -323,8 +323,8 @@ def fit(self, times: np.ndarray, dfs: np.ndarray):
323323
324324 elif self ._interp_type == InterpTypes .TENSION_ZERO_RATES :
325325 tension_sigma = self ._optional_interp_params .get ("sigma" , 1.0 )
326- g_small_vector = np .ones (len (self ._times )) * g_small
327- zero_rates = - np .log (self ._dfs ) / (self ._times + g_small_vector )
326+ G_SMALL_vector = np .ones (len (self ._times )) * G_SMALL
327+ zero_rates = - np .log (self ._dfs ) / (self ._times + G_SMALL_vector )
328328
329329 if self ._times [0 ] == 0.0 :
330330 zero_rates [0 ] = zero_rates [1 ]
@@ -349,7 +349,7 @@ def interpolate(self, t: float):
349349 print (t )
350350 raise FinError ("Interpolate times must all be >= 0" )
351351
352- if np .abs (t ) < g_small :
352+ if np .abs (t ) < G_SMALL :
353353 return 1.0
354354
355355 tvec = np .array ([t ])
0 commit comments