import numpy as np
import os
import pandas as pd

# TEMP: debug while I figure out what's going wrong with my Jupyter notebook
# TODO: remember to delete this later
import jupyter_client
print('Jupyter + v' + jupyter_client.__version__)

# Python runs from a different directory location, so if we want to load a
# 'sidecar' file, then we need to work out the correct dir_path to our project.
# TODO: maybe I should use dirname() here instead of hard-coding the dir_path?
# Need to check whether that works or not...

#dir_path = os.path.dirname(__file__)
dir_path = 'C:\\RiskScapeProjects\\project-setup\\'
df = pd.read_csv(os.path.join(dir_path, 'DS_1-fragility-curve.csv'))

def function(exposure, depth):
    return np.interp(depth, df['hazard'], df['fragility'])
