diff options
| -rw-r--r-- | python/analytics/index.py | 8 | ||||
| -rw-r--r-- | python/analytics/option.py | 6 |
2 files changed, 7 insertions, 7 deletions
diff --git a/python/analytics/index.py b/python/analytics/index.py index 98f399de..b06891f9 100644 --- a/python/analytics/index.py +++ b/python/analytics/index.py @@ -50,14 +50,14 @@ def g(index, spread, exercise_date, pv=None): class Index(object): """ minimal class to represent a credit index """ - __slots__ = ['fixed_rate', 'notional', '_start_date', '_end_date', + __slots__ = ('fixed_rate', 'notional', '_start_date', '_end_date', 'recovery', '_version', '_fee_leg', '_default_leg', '_value_date', '_yc', '_sc', '_risky_annuity', '_spread', '_price', 'name', 'issue_date', '_quote_is_price', '_direction', 'currency', '_step_in_date', '_accrued', '_cash_settle_date', '_dl_pv', '_pv', '_clean_pv', '_original_clean_pv', '_trade_date', - 'index_type', 'series', 'tenor', '_observed'] + 'index_type', 'series', 'tenor', '_observed') def __init__(self, start_date, end_date, recovery, fixed_rate, notional=10e6, quote_is_price=False, issue_date=None): """ @@ -502,9 +502,9 @@ class Index(object): class ForwardIndex(object): - __slots__ = ['index', 'forward_date', 'exercise_date_settle', 'df', + __slots__ = ('index', 'forward_date', 'exercise_date_settle', 'df', '_forward_annuity', '_forward_pv', '_forward_spread', - '__weakref__'] + '__weakref__') def __init__(self, index, forward_date, observer=True): self.index = index if isinstance(forward_date, pd.Timestamp): diff --git a/python/analytics/option.py b/python/analytics/option.py index 12875221..d76c1888 100644 --- a/python/analytics/option.py +++ b/python/analytics/option.py @@ -75,8 +75,8 @@ def ATMstrike(index, exercise_date): class BlackSwaption(ForwardIndex): """Swaption class""" - __slots__ = ['_T', '_G', '_strike', 'option_type', - 'notional', 'sigma', '_original_pv', '_direction'] + __slots__ = ('_T', '_G', '_strike', 'option_type', + 'notional', 'sigma', '_original_pv', '_direction') def __init__(self, index, exercise_date, strike, option_type="payer", direction="Long"): @@ -355,7 +355,7 @@ class BlackSwaption(ForwardIndex): return "{} at 0x{:02x}".format(type(self), id(self)) class Swaption(BlackSwaption): - __slots__ = ["_cache", "_Z", "_w"] + __slots__ = ("_cache", "_Z", "_w") def __init__(self, index, exercise_date, strike, option_type="payer", direction="Long"): super().__init__(index, exercise_date, strike, option_type, direction) |
