diff options
| author | Guillaume Horel <guillaume.horel@gmail.com> | 2016-11-15 18:26:22 -0500 |
|---|---|---|
| committer | Guillaume Horel <guillaume.horel@gmail.com> | 2016-11-15 18:26:22 -0500 |
| commit | 6e59edd66526004f70a714d2bbc23f424d5deda4 (patch) | |
| tree | 27db466c30b4c0fb28873559b71daee68cf867b4 | |
| parent | 76064859c2d24ea1c44aa9839e09bfdada284000 (diff) | |
| download | pyisda-6e59edd66526004f70a714d2bbc23f424d5deda4.tar.gz | |
better error message
| -rw-r--r-- | pyisda/flat_hazard.pyx | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/pyisda/flat_hazard.pyx b/pyisda/flat_hazard.pyx index daeac41..7bf548a 100644 --- a/pyisda/flat_hazard.pyx +++ b/pyisda/flat_hazard.pyx @@ -179,11 +179,12 @@ def pv_vec(double[:] spreads, YieldCurve yc, trade_date, value_date, 1e-10, # xacc */ 1e-10, # facc */ &h) != 0: - printf("failed to find the root") + printf("Failed to find hazard rate for %f:\n", spreads[i]) + break sc.fArray[0].fRate = h if JpmcdsFeeLegPV(fee_leg, trade_date_c, step_in_date_c, value_date_c, yc._thisptr, sc, True, &coupon_leg_pv) != 0: - printf("Something went wrong") + printf("Something went wrong\n") pv[i] = coupon_leg_pv * (spreads[i] - fixed_rate) free(params) JpmcdsFeeLegFree(fee_leg) |
