ebm.model.energy_requirement module
- class EnergyRequirement(building_code_list: List[str], period: YearRange = YearRange(start=2010, end=2050), calibration_year: int = 1999, database_manager=None)[source]
Bases:
object- __init__(building_code_list: List[str], period: YearRange = YearRange(start=2010, end=2050), calibration_year: int = 1999, database_manager=None)[source]
- calculate_for_building_category(database_manager: DatabaseManager = None) DataFrame[source]
Calculates energy requirements for a single building category
Parameters
- database_manager: DatabaseManager
optional database_manager used to load input parameters
Returns
- Iterable of pd.Series
indexed by year, building_category, TEK, purpose, building_condition column kwh_m2 representing energy requirement
- calculate_energy_requirement(all_building_categories, all_purpose, all_building_codes, energy_requirement_original_condition, model_years, most_conditions, database_manager) DataFrame[source]
- calculate_energy_reduction(energy_requirements: DataFrame, model_years: YearRange, policy_improvement: DataFrame, reduction_per_condition: DataFrame, yearly_improvement: DataFrame) DataFrame[source]
Calculate and combine all reduction factors for energy needs into a single Dataframe.
Parameters
energy_requirements : pd.DataFrame model_years : YearRange policy_improvement : pd.DataFrame reduction_per_condition : pd.DataFrame yearly_improvement : pd.DataFrame
Returns
pd.DataFrame
- merge_energy_requirement_reductions(condition_factor, yearly_improvements, reduction_policy)[source]
- calculate_reduction_yearly(df_years: DataFrame, yearly_improvement: DataFrame) DataFrame[source]
Calculate factor for yearly reduction for each entry in the DataFrame yearly_improvement.
This method merges the yearly improvement data with the policy improvement data, adjusts the efficiency start year if the period end year is greater, and calculates the yearly reduction based on the yearly efficiency improvement.
Parameters
- df_yearspd.DataFrame
DataFrame containing all years for which to calculate factors. Must include column ‘year’.
- yearly_improvementpd.DataFrame
DataFrame containing yearly improvement information. Must include columns ‘yearly_efficiency_improvement’, and ‘efficiency_start_year’.
Returns
- pd.DataFrame
DataFrame with the calculated ‘reduction_yearly’ column and updated entries.
- calculate_reduction_policy(policy_improvement: DataFrame, all_things) DataFrame[source]
Calculate the reduction policy for each entry in the DataFrame.
This method computes the reduction policy by first calculating the number of years since the start of the period. It then applies the yearly_reduction function to each relevant entry to determine the reduction policy.
Parameters
- policy_improvementpd.DataFrame
DataFrame containing policy improvement information. Must include columns ‘year’ and ‘period_start_year’.
- all_things: pd.DataFrame
DataFrame containing every combination of building_category, TEK, purpose, year
Returns
- pd.DataFrame
DataFrame with the calculated ‘reduction_policy’ column and updated entries.
- calculate_reduction_condition(reduction_per_condition: DataFrame) DataFrame[source]
Calculate the reduction condition for each entry in the DataFrame.
This method computes the reduction condition by subtracting the reduction share from 1.0. It also fills any NaN values in the ‘reduction_condition’ column with 1.0.
Parameters
- reduction_per_conditionpd.DataFrame
DataFrame containing the reduction share information. Must include columns ‘reduction_share’ and ‘building_code’.
Returns
- pd.DataFrame
DataFrame with the calculated ‘reduction_condition’ column and filtered entries.
- calculate_energy_requirements(building_categories: Iterable[BuildingCategory] = None) DataFrame[source]
Calculates energy requirements for building categories
Parameters
- building_categoriesIterable[BuildingCategory]
Iterable containing building categories on which to calculate energy requirements.
Returns
- Iterable of pd.Series
indexed by year, building_category, TEK, purpose, building_condition column kwh_m2 representing energy requirement