ebm.model.scurve module

class SCurve(earliest_age: int, average_age: int, last_age: int, rush_years: int, rush_share: float, never_share: float, building_lifetime: int = 130)[source]

Bases: object

Calculates S-curve per building condition.

Raises

ValueError

When any of the arguments are less than zero

Notes

To make calculations return better rounded more and accurate results, _rush_share and _never_share area multiplied by 100 internally. _calc_pre_rush_rate() _calc_rush_rate() _calc_post_rush_rate() will still return percent as a value between 0 and 1.

earliest_age: int = 0
average_age: int
last_age: int
rush_years: int
rush_share: float
never_share: float
building_lifetime: int = 130
__init__(earliest_age: int, average_age: int, last_age: int, rush_years: int, rush_share: float, never_share: float, building_lifetime: int = 130)[source]
get_rates_per_year_over_building_lifetime() Series[source]

Create a series that holds the yearly measure rates over the building lifetime.

This method defines the periods in the S-curve, adds the yearly measure rates to the corresponding periods, and stores them in a pandas Series.

Returns

pd.Series

A Series containing the yearly measure rates over the building lifetime with an index representing the age from 1 to the building lifetime.

calc_scurve() Series[source]

Calculates the S-curve by accumulating the yearly measure rates over the building’s lifetime.

This method returns a pandas Series representing the S-curve, where each value corresponds to the accumulated rate up to that age.

Returns

pd.Series
A Series containing the accumulated rates of the S-curve with an index representing the age from 1 to the

building lifetime.

main()[source]