aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--python/analytics/tranche_functions.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/python/analytics/tranche_functions.py b/python/analytics/tranche_functions.py
index a86ee169..ab975a55 100644
--- a/python/analytics/tranche_functions.py
+++ b/python/analytics/tranche_functions.py
@@ -1,6 +1,7 @@
import numpy as np
from ctypes import POINTER, c_int, c_double, byref
from numpy.ctypeslib import ndpointer
+from pathlib import Path
from pyisda.legs import FeeLeg
from pyisda.date import previous_twentieth
from quantlib.time.schedule import Schedule, CDS2015, OldCDS
@@ -16,7 +17,6 @@ from quantlib.time.api import (
import pandas as pd
from scipy.special import h_roots
from .utils import next_twentieth
-import os
def wrapped_ndpointer(*args, **kwargs):
@@ -31,7 +31,7 @@ def wrapped_ndpointer(*args, **kwargs):
libloss = np.ctypeslib.load_library(
- "lossdistrib", os.path.join(os.environ["CODE_DIR"], "python", "analytics")
+ "lossdistrib", Path(__file__).parent
)
libloss.fitprob.restype = None