[1]:
from buildingmodel import data_path
from pathlib import Path
import seaborn as sns
import geopandas as gpd
from buildingmodel.main import Parameters, run_all
import os
from shapely.geometry import Polygon
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
[14]:
parameters = Parameters(
districts="districts_test_sample_new.gpkg",
census="district_level_census_test_sample.hdf",
district_level_diagnosis="district_level_diagnosis_data_test_sample.hdf",
date_format="%Y-%m-%d",
gas_network_route="gas_network_route_sample.gpkg",
)
building_data = Path(data_path["gis"]) / "testing" / "test_sample.gpkg"
climate_data = Path(data_path["climate"]) / "Brest.epw"
[16]:
buildings, boundaries, climate, dwellings = run_all(
building_data, climate_data, parameters
)
/home/yassine/miniconda3/envs/buildingmodel_dev/lib/python3.8/site-packages/topojson/core/cut.py:112: ShapelyDeprecationWarning: STRtree will be changed in 2.0.0 and will not be compatible with versions < 2.
tree_splitter = STRtree(mp)
[4]:
buildings.head()
[4]:
geometry | main_usage | secondary_usage | construction_date | dwelling_count | floor_count | wall_material | roof_material | height | altitude_min | ... | peak_final_consumption | peak_final_consumption_by_surface | peak_primary_consumption | peak_primary_consumption_by_surface | volume | annual_ventilation_losses | annual_thermal_losses | annual_occupant_gains | conventional_thermal_losses | conventional_occupant_gains | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | POLYGON ((842329.700 6481862.000, 842318.300 6... | residential | NaN | 2008-01-01 | 5.0 | 2.0 | 05 | 01 | 5.0 | 243.0 | ... | 0.0 | 0.0 | 0.0 | 0.0 | 1186.375 | 16627.392189 | 43086.059349 | 9388.529795 | 39146.190378 | 5796.596234 |
1 | POLYGON ((842220.400 6481973.000, 842220.800 6... | unknown | NaN | None | 0.0 | 1.0 | None | None | 4.0 | 232.8 | ... | 0.0 | 0.0 | 0.0 | 0.0 | 246.340 | NaN | NaN | NaN | NaN | NaN |
2 | POLYGON ((842210.100 6481958.900, 842205.600 6... | unknown | NaN | None | 0.0 | 1.0 | None | None | 4.0 | 232.1 | ... | 0.0 | 0.0 | 0.0 | 0.0 | 118.720 | NaN | NaN | NaN | NaN | NaN |
3 | POLYGON ((842232.800 6481970.400, 842234.400 6... | industrial | NaN | None | 0.0 | 1.0 | None | None | 3.0 | 233.4 | ... | 0.0 | 0.0 | 0.0 | 0.0 | 320.790 | NaN | NaN | NaN | NaN | NaN |
4 | POLYGON ((842249.600 6481972.800, 842255.200 6... | unknown | NaN | None | 0.0 | 1.0 | None | None | 6.0 | 233.9 | ... | 0.0 | 0.0 | 0.0 | 0.0 | 380.730 | NaN | NaN | NaN | NaN | NaN |
5 rows × 158 columns
[5]:
buildings["wall_material"].value_counts()
[5]:
wall_material
20 7
23 5
50 2
05 1
00 1
40 1
02 1
34 1
90 1
36 1
35 1
Name: count, dtype: int64
[6]:
buildings.columns.tolist()
[6]:
['geometry',
'main_usage',
'secondary_usage',
'construction_date',
'dwelling_count',
'floor_count',
'wall_material',
'roof_material',
'height',
'altitude_min',
'altitude_max',
'name',
'conventional_heating_set_point',
'actual_heating_set_point',
'altitude',
'construction_year',
'construction_year_class',
'wall_class',
'roof_class',
'floor_area',
'residential_type',
'multi_dwelling',
'residential_only',
'has_annex',
'district',
'city',
'city_group',
'department',
'region',
'has_network_city_level',
'has_network_grdf_data',
'to_sim',
'building_id',
'exterior_wall_area',
'adjacent_wall_area',
'roof_area',
'exterior_floor_area',
'floor_area_share',
'gas_network_distance',
'gas_network_connection',
'living_area',
'living_area_share',
'heating_system',
'air_change_rate',
'main_heating_system_efficiency',
'main_heating_energy',
'backup_heating_system_efficiency',
'backup_heating_energy',
'backup_heating_share',
'dhw_energy',
'wall_u_value',
'roof_u_value',
'floor_u_value',
'inference_geo_level',
'conventional_unified_degree_hours',
'conventional_ventilation_losses',
'actual_unified_degree_hours',
'actual_ventilation_losses',
'heating_season_duration',
'maximal_temperature_difference',
'peak_ventilation_losses',
'heated_area_share',
'conventional_intermittency_factor',
'regulation_factor',
'intermittency_factor',
'conventional_heating_needs',
'annual_heating_needs',
'peak_heating_needs',
'annual_solar_gains',
'annual_boundary_losses',
'annual_specific_needs',
'peak_specific_needs',
'annual_cooking_needs',
'peak_cooking_needs',
'annual_dhw_needs',
'peak_dhw_needs',
'annual_electricity_consumption',
'peak_electricity_consumption',
'annual_electricity_heating',
'peak_electricity_heating',
'annual_electricity_dhw',
'peak_electricity_dhw',
'annual_fossil_gas_consumption',
'peak_fossil_gas_consumption',
'annual_fossil_gas_heating',
'peak_fossil_gas_heating',
'annual_fossil_gas_dhw',
'peak_fossil_gas_dhw',
'annual_liquified_petroleum_gas_consumption',
'peak_liquified_petroleum_gas_consumption',
'annual_liquified_petroleum_gas_heating',
'peak_liquified_petroleum_gas_heating',
'annual_liquified_petroleum_gas_dhw',
'peak_liquified_petroleum_gas_dhw',
'annual_oil_consumption',
'peak_oil_consumption',
'annual_oil_heating',
'peak_oil_heating',
'annual_oil_dhw',
'peak_oil_dhw',
'annual_biomass_consumption',
'peak_biomass_consumption',
'annual_biomass_heating',
'peak_biomass_heating',
'annual_biomass_dhw',
'peak_biomass_dhw',
'annual_district_network_consumption',
'peak_district_network_consumption',
'annual_district_network_heating',
'peak_district_network_heating',
'annual_district_network_dhw',
'peak_district_network_dhw',
'annual_electricity_specific',
'peak_electricity_specific',
'annual_electricity_cooking',
'peak_electricity_cooking',
'annual_fossil_gas_cooking',
'peak_fossil_gas_cooking',
'annual_liquified_petroleum_gas_cooking',
'peak_liquified_petroleum_gas_cooking',
'conventional_electricity_consumption',
'conventional_electricity_heating',
'conventional_electricity_dhw',
'conventional_fossil_gas_consumption',
'conventional_fossil_gas_heating',
'conventional_fossil_gas_dhw',
'conventional_liquified_petroleum_gas_consumption',
'conventional_liquified_petroleum_gas_heating',
'conventional_liquified_petroleum_gas_dhw',
'conventional_oil_consumption',
'conventional_oil_heating',
'conventional_oil_dhw',
'conventional_biomass_consumption',
'conventional_biomass_heating',
'conventional_biomass_dhw',
'conventional_district_network_consumption',
'conventional_district_network_heating',
'conventional_district_network_dhw',
'conventional_dhw_needs',
'diagnosis_class',
'conventional_final_consumption',
'conventional_final_consumption_by_surface',
'conventional_primary_consumption',
'conventional_primary_consumption_by_surface',
'total_final_consumption',
'total_final_consumption_by_surface',
'total_primary_consumption',
'total_primary_consumption_by_surface',
'peak_final_consumption',
'peak_final_consumption_by_surface',
'peak_primary_consumption',
'peak_primary_consumption_by_surface',
'volume',
'annual_ventilation_losses',
'annual_thermal_losses',
'annual_occupant_gains',
'conventional_thermal_losses',
'conventional_occupant_gains']
[7]:
buildings["need_by_surface"] = (
buildings["annual_heating_needs"] / buildings["living_area"]
)
buildings["peak_by_surface"] = (
buildings["peak_heating_needs"] / buildings["living_area"]
)
[8]:
buildings.dropna(subset="need_by_surface")["need_by_surface"]
[8]:
0 33.541984
7 54.024548
8 56.220984
9 35.412665
10 42.090895
11 69.174999
12 36.601221
13 37.912058
14 100.496767
15 41.197269
17 37.696968
18 42.286203
19 58.714850
20 44.604127
21 51.112449
22 110.827618
23 43.907727
24 43.612361
25 67.951703
26 41.268580
27 34.874124
28 143.539946
Name: need_by_surface, dtype: float64
[9]:
sns.histplot(buildings, x="need_by_surface")
[9]:
<Axes: xlabel='need_by_surface', ylabel='Count'>

[10]:
sns.histplot(buildings, x="peak_by_surface")
[10]:
<Axes: xlabel='peak_by_surface', ylabel='Count'>

[12]:
buildings.to_crs("EPSG:4326").explore(column="need_by_surface")
[12]:
Make this Notebook Trusted to load map: File -> Trust Notebook