summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuillaume Horel <guillaume.horel@gmail.com>2019-02-15 13:17:41 -0500
committerGuillaume Horel <guillaume.horel@gmail.com>2019-02-15 13:17:41 -0500
commit1ba4c793531c551d5e3c5744c6307422c93162ce (patch)
treef30a3fd7c466bfa66bed8b2afcd73d23441fb70c
parentf7cd1a424daa2cef75fc028931599e51fe707536 (diff)
downloadpyisda-1ba4c793531c551d5e3c5744c6307422c93162ce.tar.gz
fix reduce
-rw-r--r--pyisda/credit_index.pyx7
1 files changed, 3 insertions, 4 deletions
diff --git a/pyisda/credit_index.pyx b/pyisda/credit_index.pyx
index b2c8913..8d2bf34 100644
--- a/pyisda/credit_index.pyx
+++ b/pyisda/credit_index.pyx
@@ -162,7 +162,7 @@ cdef class CurveList:
sc.ticker = p.first
sc.recovery_rates = self.recovery_rates[p.second]
sc.defaulted = self.defaulted[p.second]
- r.append(sc)
+ r.append((self._weights[p.second], sc))
return r
@curves.setter
@@ -199,8 +199,7 @@ cdef class CurveList:
# return copy
def __reduce__(self):
- return (self.__class__, (self.curves, self.weights,
- TDate_to_pydate(self.base_date)))
+ return (self.__class__, (self.curves, TDate_to_pydate(self.base_date)))
@cython.auto_pickle(False)
cdef class CreditIndex(CurveList):
@@ -261,7 +260,7 @@ cdef class CreditIndex(CurveList):
def __reduce__(self):
return (self.__class__,
(TDate_to_pydate(self.start_date), self.maturities, self.curves,
- self.weights, TDate_to_pydate(self.base_date)))
+ TDate_to_pydate(self.base_date)))
def __hash__(self):
cdef: