diff options
Diffstat (limited to 'python/analytics/tranche_basket.py')
| -rw-r--r-- | python/analytics/tranche_basket.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/python/analytics/tranche_basket.py b/python/analytics/tranche_basket.py index 8d69edb1..4c67f06c 100644 --- a/python/analytics/tranche_basket.py +++ b/python/analytics/tranche_basket.py @@ -55,7 +55,7 @@ class dSkew: class Skew: - _cache = LRU(64) + __cache = LRU(64) def __init__(self, el: float, skew: CubicSpline): self.el = el @@ -89,8 +89,8 @@ class Skew: key = ("IG", 29, "5yr", value_date) else: key = (index_type, series, tenor, value_date) - if key in Skew._cache: - return Skew._cache[key] + if key in cls.__cache: + return cls.__cache[key] else: conn = serenitas_pool.getconn() sql_str = ( @@ -127,7 +127,7 @@ class Skew: K = adjust_attachments(K, cumloss / 100, factor / 100) skew_fun = CubicSpline(np.log(K[1:-1] / el), logit(rho), bc_type="natural") s = Skew(el, skew_fun) - Skew._cache[key] = s + cls.__cache[key] = s return s def plot(self, moneyness_space=True): @@ -149,7 +149,7 @@ class Skew: class DualCorrTranche: - _cache = LRU(512) + __cache = LRU(512) _Legs = namedtuple("Legs", "coupon_leg, protection_leg, bond_price") def __init__( |
