aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--python/tranche_functions.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/python/tranche_functions.py b/python/tranche_functions.py
index 090e9072..f6c5ab35 100644
--- a/python/tranche_functions.py
+++ b/python/tranche_functions.py
@@ -5,8 +5,10 @@ from quantlib.time.api import Actual360, Period, UnitedStates, Following, today
from quantlib.util.converter import qldate_to_pydate, pydate_to_qldate
import pandas as pd
from scipy.special import h_roots
+from common import root
+import os
-libloss = np.ctypeslib.load_library("lossdistrib", "/home/share/CorpCDOs/code/R/lossdistrib/src")
+libloss = np.ctypeslib.load_library("lossdistrib", os.path.join(root, "code/R/lossdistrib/src"))
libloss.fitprob.restype = None
libloss.fitprob.argtypes = [
np.ctypeslib.ndpointer('double', ndim=1, flags='F'),
@@ -43,7 +45,7 @@ libloss.BCloss_recov_dist.argtypes = [
np.ctypeslib.ndpointer('double', ndim=2, flags='F,writeable')# output R
]
-libgq = np.ctypeslib.load_library("GHquad", ".")
+libgq = np.ctypeslib.load_library("GHquad", os.path.join(root, "code", "python"))
libgq.GHquad.restype = None
libgq.GHquad.argtypes = [c_int,
np.ctypeslib.ndpointer('double', ndim=1, flags='F'),