diff options
Diffstat (limited to 'python')
| -rw-r--r-- | python/analytics/index_data.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/python/analytics/index_data.py b/python/analytics/index_data.py index 13a4a8bc..fc660df6 100644 --- a/python/analytics/index_data.py +++ b/python/analytics/index_data.py @@ -235,18 +235,20 @@ def _get_singlenames_curves(index_type, series, trade_date, tenors): f"{index_type.lower()}{series}", trade_date, tenors ) args = (np.array(tenors, dtype="float"),) - return build_curves(sn_quotes, args) + return build_curves_dist(sn_quotes, args) def get_singlenames_curves( - index_type, series, trade_date, tenors=(0.5, 1, 2, 3, 4, 5, 7, 10) + index_type, series, trade_date, tenors=(0.5, 1, 2, 3, 4, 5, 7, 10), use_cache=True ): # tenors need to be a subset of (0.5, 1, 2, 3, 4, 5, 7, 10) if isinstance(trade_date, pd.Timestamp): trade_date = trade_date.date() - return _get_singlenames_curves( - index_type, series, min(datetime.date.today(), trade_date), tenors - ) + if use_cache: + fun = _get_singlenames_curves + else: + fun = _get_singlenames_curves.__wrapped__ + return fun(index_type, series, min(datetime.date.today(), trade_date), tenors) def get_tranche_quotes( |
