diff options
Diffstat (limited to 'python/load_cf.py')
| -rw-r--r-- | python/load_cf.py | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/python/load_cf.py b/python/load_cf.py index 3eb5a20f..cdbb4b2e 100644 --- a/python/load_cf.py +++ b/python/load_cf.py @@ -17,11 +17,6 @@ from optimization import KLfit import rpy2.robjects as ro
import sys
-if os.name =='nt':
- root = "//WDsentinel/share/CorpCDOs"
-elif os.name == 'posix':
- root = '/home/share/CorpCDOs'
-
def sanitize_float(string):
try:
string = string.replace(",","")
@@ -34,7 +29,7 @@ def sanitize_float(string): def processzipfiles(tradedate=datetime.date.today()):
- pricesdir = os.path.join(root, "Scenarios", "Prices_" + str(tradedate))
+ pricesdir = os.path.join(os.environ['BASE_DIR'], "Scenarios", "Prices_" + str(tradedate))
zipfiles = [os.path.join(pricesdir, f) for f in os.listdir(pricesdir) \
if f.endswith(".zip")]
zipfiles = sorted(zipfiles, key=lambda x: os.stat(x).st_ctime)
@@ -54,7 +49,7 @@ def processzipfiles(tradedate=datetime.date.today()): def get_configfile(dealname, tradedate):
- configfile = os.path.join(root, "Scenarios", "Intex curves_" + str(tradedate),
+ configfile = os.path.join(os.environ['BASE_DIR'], "Scenarios", "Intex curves_" + str(tradedate),
"csv", dealname + ".config")
try:
with open(configfile) as fh:
@@ -64,7 +59,7 @@ def get_configfile(dealname, tradedate): return config
def get_dist(date):
- distfile = os.path.join(root, "Scenarios", "Calibration",
+ distfile = os.path.join(os.environ['BASE_DIR'], "Scenarios", "Calibration",
"marketdata-{0:%Y-%m-%d}.RData".format(date))
dist = ro.r.load(distfile)
return {"L": np.array(dist[0]),"R": np.array(dist[1])}
|
