diff options
| -rw-r--r-- | pyisda/credit_index.pyx | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/pyisda/credit_index.pyx b/pyisda/credit_index.pyx index 8bfc769..ab78ce7 100644 --- a/pyisda/credit_index.pyx +++ b/pyisda/credit_index.pyx @@ -16,10 +16,13 @@ from cdsone cimport JpmcdsStringToStubMethod, TStubMethod from date cimport ACT_365F cimport numpy as np np.import_array() +import numpy as np import pandas as pd cdef class CurveList: - def __init__(self, list curves, double[:] weights=None): + + @cython.initializedcheck(False) + def __init__(self, list curves not None, double[:] weights=None): cdef: SpreadCurve sc size_t i @@ -91,8 +94,8 @@ cdef class CurveList: @property def weights(self): cdef np.npy_intp shape = self.weights.size() - cdef np.ndarray[np.float64_t] out = \ - np.PyArray_SimpleNewFromData(1, &shape, np.NPY_DOUBLE, self.weights.data()) + cdef np.ndarray out = \ + np.PyArray_SimpleNewFromData(1, &shape, np.NPY_DOUBLE, self.weights.data()) out.base = <PyObject*>self Py_INCREF(self) return out @@ -116,7 +119,7 @@ cdef class CurveList: return r @curves.setter - def curves(self, list l): + def curves(self, list l not None): cdef: size_t len_l = len(l) size_t i |
