ebm.saving module
- energy_need_net_construction(energy_need: DataFrame, net_construction: DataFrame) DataFrame[source]
- reduced_construction_kwh(energy_need_net_construction: DataFrame) DataFrame[source]
Compute construction-related energy changes based on reduced energy intensity.
Parameters
- energy_need_net_constructionpandas.DataFrame
DataFrame containing at least the following columns: - reduced_kwh_m2 : float
Energy need after reductions (kWh per m²).
- m2float
Original total area (m²).
- net_construction_m2float
Net area change due to construction (m²). Positive values reduce effective area; negative values increase it.
Returns
- pandas.DataFrame
Copy of the input DataFrame with three additional columns: - reduced_construction_kwh : float
Energy after applying net construction area change (reduced_kwh_m2 * (m2 - net_construction_m2)).
- net_construction_kwhfloat
Energy need of the constructed area (reduced_kwh_m2 * m2).
Notes
No clamping is applied; if net_construction_m2 > m2, the reduced energy may become negative. Validate upstream if needed.
Assumes all required columns exist and are numeric.
Examples
>>> import pandas as pd >>> df = pd.DataFrame({ ... "kwh_m2": [120.0, 95.5], ... "m2": [1000.0, 2500.0], ... "net_construction_m2": [200.0, -100.0], ... }) >>> reduced_construction_kwh(df)[[ ... "original_construction_kwh", ... "reduced_construction_kwh", ... "net_construction_kwh" ... ]] original_construction_kwh reduced_construction_kwh net_construction_kwh 0 120000.0 96000.0 24000.0 1 238750.0 248525.0 -9775.0
- reduction_policy_kwh(energy_need: DataFrame) DataFrame[source]
Calculate energy need changed by yearly reduction in KWh.
Parameters
- energy_needpd.DataFrame
- Must include the columns:
original_kwh_m2
m2
reduction_policy
reduction_yearly
reduction_condition
Returns
- pd.DataFrame
Original DataFrame with two new columns: - reduction_policy_kwh_m2: Difference per m² - reduction_policy_kwh: Difference for total area
- reduction_yearly_kwh(energy_need: DataFrame) DataFrame[source]
Calculate energy need changed by condition in KWh.
Parameters
- energy_needpd.DataFrame
- Must include the columns:
original_kwh_m2
m2
reduction_yearly
reduction_policy
reduction_condition
Returns
- pd.DataFrame
Original DataFrame with two new columns: - reduction_yearly_kwh_m2: Difference per m² - reduction_yearly_kwh: Difference for total area
- reduction_condition_kwh(energy_need: DataFrame) DataFrame[source]
Calculate energy need changed by condition in KWh.
Parameters
- energy_needpd.DataFrame
- Must include the columns:
calibrated_kwh_m2
m2
reduction_yearly
reduction_policy
reduction_condition
Returns
- pd.DataFrame
Original DataFrame with two new columns: - reduction_condition_kwh_m2: Difference per m² - reduction_condition_kwh: Difference for total area
- flat_household_size(dm: DatabaseManager, period: YearRange = YearRange(start=2020, end=2050)) DataFrame[source]