mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
establishing sttruture for heating system mapping
This commit is contained in:
parent
6cb20b4828
commit
3c832b1aca
2 changed files with 96 additions and 2 deletions
13
backend/onboarders/epc/placeholder.py
Normal file
13
backend/onboarders/epc/placeholder.py
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
from enum import Enum
|
||||
|
||||
|
||||
class EpcFuel(Enum):
|
||||
electricity_not_community = "electricity (not community)"
|
||||
|
||||
|
||||
class EpcHeatingControls(Enum):
|
||||
programmer_room_thermostat_trvs = "Programmer, room thermostat and TRVs"
|
||||
|
||||
|
||||
class EpcHeatingSystems(Enum):
|
||||
boiler_and_radiators_electric = "Boiler and radiators, electric"
|
||||
|
|
@ -7,6 +7,7 @@ from backend.onboarders.mappings.age_band import parity_map as age_band_map
|
|||
from backend.onboarders.mappings.built_form import parity_map as built_form_map
|
||||
from backend.onboarders.epc_descriptions import EpcWallDescriptions, EpcConstructionAgeBand, EpcEfficiency, \
|
||||
WALL_DESCRIPTION_EFFICIENCIES, EpcRoofDescriptions, resolve_roof_efficiency, EpcFloorDescriptions
|
||||
from backend.onboarders.epc.placeholder import EpcFuel, EpcHeatingControls, EpcHeatingSystems
|
||||
from backend.onboarders.mappings.as_built_wall_classifiers import AS_BUILT_WALL_CLASSIFIERS
|
||||
from backend.onboarders.mappings.as_built_roof_classifiers import AS_BUILT_ROOF_CLASSIFIERS
|
||||
from backend.onboarders.mappings.as_built_floor_classifiers import unknown_floor_as_built, unknown_floor_retrofitted, \
|
||||
|
|
@ -456,13 +457,93 @@ data[["landlord_windows_description",
|
|||
# Peform the remapping. The columns we wish to produce are the following:
|
||||
# 1) landlord_windows_description
|
||||
# 2) landlord_windows_efficiency
|
||||
# 3) landlord_multi_glaze_proportion - maybe don't need to set this, same for glazing typd and area
|
||||
# 3) landlord_multi_glaze_proportion - maybe don't need to store this, same for glazing type and area
|
||||
|
||||
|
||||
# ------------ Heating ------------
|
||||
|
||||
agg = data.groupby(['Heating', 'Boiler Efficiency', 'Main Fuel', 'Controls Adequacy']).size().reset_index(name='counts')
|
||||
|
||||
agg = data.groupby(['Heating', 'Boiler Efficiency', 'Main Fuel']).size().reset_index(name='counts')
|
||||
# We map to:
|
||||
# 1) Heating description
|
||||
# 2) Heating efficiency
|
||||
# 3) Fuel type
|
||||
# 4) Heating controls
|
||||
|
||||
heating_map = {
|
||||
|
||||
('Boilers', 'A', 'ElectricityNotCommunity', 'Optimal'): (
|
||||
EpcHeatingSystems.boiler_and_radiators_electric, EpcEfficiency.VERY_POOR, EpcFuel.electricity_not_community,
|
||||
EpcHeatingControls.programmer_room_thermostat_trvs
|
||||
),
|
||||
('Boilers', 'A', 'ElectricityNotCommunity', 'Sub Optimal'): None,
|
||||
('Boilers', 'A', 'ElectricityNotCommunity', 'Top Spec'): None,
|
||||
('Boilers', 'A', 'LPGNotCommunity', 'Optimal'): None,
|
||||
('Boilers', 'A', 'MainsGasNotCommunity', 'Optimal'): None,
|
||||
('Boilers', 'A', 'MainsGasNotCommunity', 'Sub Optimal'): None,
|
||||
('Boilers', 'A', 'MainsGasNotCommunity', 'Top Spec'): None,
|
||||
('Boilers', 'B', 'MainsGasNotCommunity', 'Optimal'): None,
|
||||
('Boilers', 'B', 'MainsGasNotCommunity', 'Sub Optimal'): None,
|
||||
('Boilers', 'B', 'MainsGasNotCommunity', 'Top Spec'): None,
|
||||
('Boilers', 'C', 'ElectricityNotCommunity', 'Optimal'): None,
|
||||
('Boilers', 'C', 'ElectricityNotCommunity', 'Sub Optimal'): None,
|
||||
('Boilers', 'C', 'ElectricityNotCommunity', 'Top Spec'): None,
|
||||
('Boilers', 'C', 'LPGNotCommunity', 'Optimal'): None,
|
||||
('Boilers', 'C', 'LPGNotCommunity', 'Sub Optimal'): None,
|
||||
('Boilers', 'C', 'MainsGasNotCommunity', 'Optimal'): None,
|
||||
('Boilers', 'C', 'MainsGasNotCommunity', 'Sub Optimal'): None,
|
||||
('Boilers', 'C', 'MainsGasNotCommunity', 'Top Spec'): None,
|
||||
('Boilers', 'C', 'OilNotCommunity', 'Optimal'): None,
|
||||
('Boilers', 'C', 'OilNotCommunity', 'Sub Optimal'): None,
|
||||
('Boilers', 'C', 'OilNotCommunity', 'Top Spec'): None,
|
||||
('Boilers', 'D', 'MainsGasNotCommunity', 'Optimal'): None,
|
||||
('Boilers', 'D', 'MainsGasNotCommunity', 'Sub Optimal'): None,
|
||||
('Boilers', 'D', 'MainsGasNotCommunity', 'Top Spec'): None,
|
||||
('Boilers', 'E', 'ElectricityNotCommunity', 'Optimal'): None,
|
||||
('Boilers', 'E', 'MainsGasNotCommunity', 'Optimal'): None,
|
||||
('Boilers', 'E', 'MainsGasNotCommunity', 'Sub Optimal'): None,
|
||||
('Boilers', 'E', 'MainsGasNotCommunity', 'Top Spec'): None,
|
||||
('Boilers', 'E', 'OilNotCommunity', 'Optimal'): None,
|
||||
('Boilers', 'E', 'OilNotCommunity', 'Sub Optimal'): None,
|
||||
('Boilers', 'F', 'MainsGasNotCommunity', 'Optimal'): None,
|
||||
('Boilers', 'F', 'MainsGasNotCommunity', 'Sub Optimal'): None,
|
||||
('Boilers', 'F', 'MainsGasNotCommunity', 'Top Spec'): None,
|
||||
('Boilers', 'G', 'MainsGasNotCommunity', 'Optimal'): None,
|
||||
('Boilers', 'G', 'MainsGasNotCommunity', 'Sub Optimal'): None,
|
||||
('Boilers', 'G', 'MainsGasNotCommunity', 'Top Spec'): None,
|
||||
('Electric underfloor', 'A', 'ElectricityNotCommunity', 'Optimal'): None,
|
||||
('Electric underfloor', 'A', 'ElectricityNotCommunity', 'Sub Optimal'): None,
|
||||
('Electric underfloor', 'A', 'ElectricityNotCommunity', 'Top Spec'): None,
|
||||
('Heat pumps (warm air)', 'A', 'ElectricityNotCommunity', 'Optimal'): None,
|
||||
('Heat pumps (warm air)', 'A', 'ElectricityNotCommunity', 'Sub Optimal'): None,
|
||||
('Heat pumps (wet)', 'A', 'ElectricityNotCommunity', 'Optimal'): None,
|
||||
('Heat pumps (wet)', 'A', 'ElectricityNotCommunity', 'Sub Optimal'): None,
|
||||
('Heat pumps (wet)', 'A', 'ElectricityNotCommunity', 'Top Spec'): None,
|
||||
('Room heaters', 'A', 'ElectricityNotCommunity', 'Optimal'): None,
|
||||
('Room heaters', 'A', 'ElectricityNotCommunity', 'Sub Optimal'): None,
|
||||
('Room heaters', 'C', 'MainsGasNotCommunity', 'Sub Optimal'): None,
|
||||
('Room heaters', 'F', 'MainsGasNotCommunity', 'Sub Optimal'): None,
|
||||
('Room heaters', 'G', 'MainsGasNotCommunity', 'Optimal'): None,
|
||||
('Room heaters', 'G', 'MainsGasNotCommunity', 'Sub Optimal'): None,
|
||||
('Room heaters', 'G', 'SmokelessCoal', 'Sub Optimal'): None,
|
||||
('Storage heaters', 'A', 'ElectricityNotCommunity', 'Optimal'): None,
|
||||
('Storage heaters', 'A', 'ElectricityNotCommunity', 'Sub Optimal'): None,
|
||||
('Warm Air (not heat pump)', 'G', 'ElectricityNotCommunity', 'Sub Optimal'): None,
|
||||
('Warm Air (not heat pump)', 'G', 'MainsGasNotCommunity', 'Sub Optimal'): None
|
||||
}
|
||||
|
||||
example = list(heating_map.keys())[0]
|
||||
|
||||
example_data = data[
|
||||
(data["Heating"] == example[0]) & (data["Boiler Efficiency"] == example[1]) & (data["Main Fuel"] == example[2]) & (
|
||||
data["Controls Adequacy"] == example[3])
|
||||
]
|
||||
|
||||
example_data["UPRN"]
|
||||
|
||||
agg_tuples = {
|
||||
(row['Heating'], row['Boiler Efficiency'], row['Main Fuel']): None for _, row in agg.iterrows()
|
||||
}
|
||||
epcs = pd.read_csv("/Users/khalimconn-kowlessar/Downloads/domestic-E08000003-Manchester/certificates.csv")
|
||||
|
||||
epcs[epcs["LODGEMENT_DATE"] > "2025-07-01"]["WINDOWS_DESCRIPTION"].value_counts()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue