Demo Outputs

Code
from netzero_metrics.calcs import get_area_and_target_summaries
from netzero_metrics.tables import plot_great_tables_targets
import mdpd

df_all_building_targets = mdpd.from_md("""
|    | TargetName      | BuildingName   |   Target |
|---:|:----------------|:---------------|---------:|
|  0 | UK NZC Standard | Block A        | 137.3    |
|  1 | ambitious!     | Block A        |  40.0701 |
|  2 | UK NZC Standard | Block B        | 251.333  |
|  3 | ambitious!     | Block B        |  65.3333 |
""")
df_all_building_targets["Target"] = df_all_building_targets.Target.astype(float)

df_all_project_targets = mdpd.from_md("""
|    | TargetName      |   ProjectTarget |
|---:|:----------------|----------------:|
|  0 | UK NZC Standard |         165.526 |
|  1 | ambitious!     |          43.837 |
""")
df_all_project_targets["ProjectTarget"] = df_all_project_targets.ProjectTarget.astype(float)

ch = plot_great_tables_targets(df_all_building_targets, df_all_project_targets)
display(ch)
Project Building Targets
Summary of Project Building Targets
Target Name Target (kWh/m²/yr)
Block A Block B Project
UK NZC Standard 137.3 251.3 165.5
ambitious! 40.1 65.3 43.8
Code
import mdpd
from netzero_metrics.tables import (
    plot_great_tables_area_summary,
)

area = mdpd.from_md("""
|    | BuildingId   |   GrossInternalArea | BuildingType                          | ConstructionMethod   | BuildingName   |   TargetYear |
|---:|:-------------|--------------------:|:--------------------------------------|:---------------------------|:---------------|-------------:|
|  0 | BLDG-1       |                  50 | Office - General                      | newbuild                   | Block A        |         2025 |
|  1 | BLDG-1       |                 300 | Commercial Resi - Student Residential | retrofit-in-one-go         | Block A        |         2025 |
|  2 | BLDG-2       |                  50 | Hotel                                 | newbuild                   | Block B        |         2030 |
|  3 | BLDG-1       |                  50 | Office - Trading Floors               | newbuild                   | Block A        |         2025 |
|  4 | BLDG-1       |                   3 | Office - General                      | newbuild                   | Block A        |         2025 |
|  5 | BLDG-2       |                 100 | Hotel                                 | retrofit-in-one-go         | Block B        |         2030 |
|  6 | BLDG-1       |                 400 | Healthcare                            | retrofit-in-one-go         | Block A        |         2025 |
""")
area["GrossInternalArea"] = area["GrossInternalArea"].astype(float)
ch = plot_great_tables_area_summary(
    area,
)
display(ch)
Project Building Areas
Summary of Project Buildings Building Use Type and Construction Method
Categorisation GIA (m²)
Building Type Construction Method Block A Block B Total
Commercial Resi - Student Residential retrofit-in-one-go 300.0 0.0 300.0
Healthcare retrofit-in-one-go 400.0 0.0 400.0
Hotel newbuild 0.0 50.0 50.0
Hotel retrofit-in-one-go 0.0 100.0 100.0
Office - General newbuild 53.0 0.0 53.0
Office - Trading Floors newbuild 50.0 0.0 50.0
Total 803.0 150.0 953.0
Code
import pathlib
import pandas as pd
import mdpd
from netzero_metrics.constants import nzdata
from netzero_metrics.calcs import (
    attach_target_year_to_area,
    get_area_and_target_summaries,
)
from netzero_metrics.plots import plot_building_targets
from netzero_metrics import fdir_pkg
 
fdir_data = fdir_pkg.parent.parent / "tests" / "data"
fdir_output = fdir_pkg.parent.parent  / "tests"  / "outputs"

_area = pd.read_csv((fdir_data / "areas.csv"))
_bldg = pd.read_csv((fdir_data / "bldgs.csv"))
area = attach_target_year_to_area(_area, _bldg)

eui_uknzcb = nzdata.energy_use_intensity
eui_custom = pd.read_csv((fdir_data / "eui-custom.csv"))


(
    df_area_summary,
    di_area_weights,
    di_project_area_weights,
    df_nzc_standard_building_year_targets,
    df_all_building_targets,
    df_all_project_targets,
) = get_area_and_target_summaries(_bldg, _area, eui_custom, eui_uknzcb)
plot_building_targets(
    df_nzc_standard_building_year_targets,
    df_all_building_targets,
    df_all_project_targets,
)
Code
import pandas as pd
from IPython.display import display
from netzero_metrics.plots import (
    plot_energy_consumption,
)
df = pd.DataFrame([
    {
       'FuelType': 'Electricity',
       'EnergyConsumption': 100.0,
       'ReportingPeriod': '2019/20',
       'EnergyEndUse': 'Heating',
       'EnergyEndUseTags': '[]',
   },
   {
       'FuelType': 'Electricity',
       'EnergyConsumption': 50.0,
       'ReportingPeriod': '2019/20',
       'EnergyEndUse': 'Cooling',
       'EnergyEndUseTags': '[]',
   },
])
plot = plot_energy_consumption(df)
display(plot)