summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuillaume Horel <guillaume.horel@gmail.com>2018-03-15 14:22:07 -0400
committerGuillaume Horel <guillaume.horel@gmail.com>2018-03-15 14:22:07 -0400
commit7f8e946adea0a906a9afddd3423bb27a8df2b475 (patch)
treee00f14b842c0f07e7a4c975e38cc947340891c55
parent314a4faf9bf978fb079964e32fffe0933e40b20c (diff)
downloadpyisda-7f8e946adea0a906a9afddd3423bb27a8df2b475.tar.gz
call constructor instead
-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: