summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuillaume Horel <guillaume.horel@gmail.com>2023-05-31 14:48:47 -0400
committerGuillaume Horel <guillaume.horel@gmail.com>2023-05-31 14:48:47 -0400
commitf7d9573e7a7a4a803e3559126c27a4e09affa1e1 (patch)
treec1c9d8f9c14fa11113c423387a2aa2d06e44e839
parent27e15cb01dc73373e741930f4760d06dee3a260a (diff)
downloadpyisda-f7d9573e7a7a4a803e3559126c27a4e09affa1e1.tar.gz
bugfix
-rw-r--r--pyisda/curve.pyx12
1 files changed, 7 insertions, 5 deletions
diff --git a/pyisda/curve.pyx b/pyisda/curve.pyx
index c10ad48..937c4b6 100644
--- a/pyisda/curve.pyx
+++ b/pyisda/curve.pyx
@@ -536,15 +536,17 @@ cdef class YieldCurve(Curve):
np.ndarray[np.float64_t, ndim=1] r
c_datetime.date d
size_t i
- TDate[::1] np_dates
+ long[::1] np_dates
+ c_datetime.date[::1] np_datetimes
TDate date_c
- int scale = 1000000000 * 86400
+ long scale = 1000000000 * 86400
if d1 is None:
if isinstance(d2, np.ndarray):
- r = np.zeros_like(d2)
- for i, d in enumerate(d2):
- r[i] = JpmcdsZeroPrice(curve, pydate_to_TDate(d))
+ r = np.zeros(d2.shape[0], dtype=np.float64)
+ np_datetimes = d2
+ for i in range(np_datetimes.shape[0]):
+ r[i] = JpmcdsZeroPrice(curve, pydate_to_TDate(np_datetimes[i]))
return r
elif isinstance(d2, pd.Series):
np_dates = d2.values.view("int")