# Path: esg/interest_rate/IR_model_classes.py
# class IR_model:
#     """This class is the purely abstract class for all IR models we will implement in the future
#     see https://pymotw.com/2/abc/"""
# 
#     __metaclass__=ABCMeta
# 
#     @abstractmethod
#     def get_IR_curve(self):
#         """This method returns IR term structures per time steps and trajectories"""
#         return
# 
#     @abstractmethod
#     def get_deflator(self):
#         """This method returns deflators per time steps and trajectories"""
#         return
# 
#     @abstractmethod
#     def calibrate(self, asset_data):
#         """Calibrate the IR model onto the market environment
#             This method returns the IR_curve and deflator"""
#         return


from .IR_model_classes import IR_model
from math import exp
import numpy as np

    def discount_factors(self, trajectory):
        return [self.discount_factor_custom(trajectory, 0, t) for t in range(1, len(trajectory))]

    def test_martingale(self):
        """
        This method should be put somewhere else TO DO
        """
        for time_step in range(1, self.time_horizon):
            discount_factor = []
            epsilon = []
            i = 1
            while i <= self.N:
                self.get_IR_curve()
                discount_factor.append(self.discount_factor(begin = 0, end = time_step))
                i += 1
            epsilon.append(np.absolute(np.mean(discount_factor) - self.zcb_price[0,time_step]))
        return np.amax(epsilon)

    def get_IR_curve(self):
        """This method returns IR term structures per time steps and trajectories"""
        pass

    def get_deflator(self):
        """This method returns deflators per time steps and trajectories"""
        pass

    def calibrate(self, asset_data):
        """Calibrate the IR model onto the market environment
            This method returns the IR_curve and deflator"""

# Path: esg/interest_rate/IR_model_classes.py
# class IR_model:
#     """This class is the purely abstract class for all IR models we will implement in the future
#     see https://pymotw.com/2/abc/"""
# 
#     __metaclass__=ABCMeta
# 
#     @abstractmethod
#     def get_IR_curve(self):
#         """This method returns IR term structures per time steps and trajectories"""
#         return
# 
#     @abstractmethod
#     def get_deflator(self):
#         """This method returns deflators per time steps and trajectories"""
#         return
# 
#     @abstractmethod
#     def calibrate(self, asset_data):
#         """Calibrate the IR model onto the market environment
#             This method returns the IR_curve and deflator"""
#         return


# Path: esg/interest_rate/IR_model_util.py
from .IR_model_classes import IR_model
from math import exp
import numpy as np


    def discount_factors(self, trajectory):
        return [self.discount_factor_custom(trajectory, 0, t) for t in range(1, len(trajectory))]

    def test_martingale(self):
        """
        This method should be put somewhere else TO DO
        """
        for time_step in range(1, self.time_horizon):
            discount_factor = []
            epsilon = []
            i = 1
            while i <= self.N:
                self.get_IR_curve()
                discount_factor.append(self.discount_factor(begin = 0, end = time_step))
                i += 1
            epsilon.append(np.absolute(np.mean(discount_factor) - self.zcb_price[0,time_step]))
        return np.amax(epsilon)

    def get_IR_curve(self):
        """This method returns IR term structures per time steps and trajectories"""
        pass

    def get_deflator(self):
        """This method returns deflators per time steps and trajectories"""
        pass

    def calibrate(self, asset_data):
        """Calibrate the IR model onto the market environment
            This method returns the IR_curve and deflator"""

        pass