summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pyisda/credit_index.pyx31
1 files changed, 1 insertions, 30 deletions
diff --git a/pyisda/credit_index.pyx b/pyisda/credit_index.pyx
index e311560..4e4c0c9 100644
--- a/pyisda/credit_index.pyx
+++ b/pyisda/credit_index.pyx
@@ -160,39 +160,10 @@ cdef class CurveList:
@curves.setter
def curves(self, list l not None):
- cdef:
- size_t len_l = len(l)
- size_t i
- SpreadCurve sc
- map[string, size_t].iterator it
-
self._curves.clear()
self.tickers.clear()
self._weights.clear()
-
- sc = l[0]
- self.T.resize(sc._thisptr.get().fNumItems)
- self.base_date = sc._thisptr.get().fBaseDate
-
- for i in range(self.T.size()):
- self.T[i] = (sc._thisptr.get().fArray[i].fDate - self.base_date) / 365.
-
- i = 0
- for sc in l:
- it = self.tickers.find(sc.ticker)
- if it == self.tickers.end():
- self.tickers[sc.ticker] = i
- if sc is not None:
- self._curves.push_back(sc._thisptr)
- else:
- self._curves.push_back(shared_ptr[TCurve]())
- self._weights.push_back(1.)
- i += 1
- else:
- self._weights[deref(it).second] += 1
-
- for i in range(self._curves.size()):
- self._weights[i] /= len_l
+ CurveList.__init__(self, l)
# def __deepcopy__(self, memo):
# cdef: