Skip to content

API reference#

Basic building block of the core modelling library.

add_component(component) #

This method is used to associate a component with the Model instance.

:param component: Component to be added to the Model instance :type component: CashFlow

add_components(components) #

This method is used to associate a list of components with the Model instance.

:param components: List of component to be added to the Model instance :type components: List

project(term) #

This method is used to invoke the 'project' method in each component.

:param term: The term over which to project :type term: int :return: Results of each components project call :rtype: DataFrame

Bases: ndarray

Static cashflow object created from an Array-Like object. Subclasses numpy.ndarray

project(term, results) #

This method is used to handle the projection logic for the component.

:param term: Term over which to project :type term: int :return: StaticCashFlow object containing projected values :rtype: StaticCashFlow

Bases: ndarray

CashFlow object created from an Array-Like object. Subclasses numpy.ndarray

project(term, results) #

This method is used to handle the projection logic for the component.

:param term: Term over which to project :type term: int :return: StaticCashFlow object containing projected values :rtype: StaticCashFlow

Convert interest rate i to discount factor where discount factor = 1 / (1 + interest rate)

:param i: Interest rate :type i: float :return: Discount factor :rtype: float

Bases: ndarray

project(term, results) #

This method is used to handle the projection logic for the component.

:param term: Term over which to project :type term: int :return: StaticDiscountFactors object containing projected values :rtype: StaticDiscountFactors

Determine the number of decimal places used in rounding.

:param p: Number of decimal places to round to, default is 2. :type p: int :raises ValueError: When attempting to set negative precision. :return: global PRECISION :rtype: int

Get the current number of decimals used in rounding.

:return: global PRECISION :rtype: int