handle 99% of cases - good enough for now

This commit is contained in:
Khalim Conn-Kowlessar 2025-08-09 22:21:36 +01:00
parent 82ede4d8cd
commit 3bdadc80df
5 changed files with 21 additions and 3 deletions

View file

@ -432,7 +432,7 @@ class Funding:
# Handle the case of no heating system - electric heaters assumed # Handle the case of no heating system - electric heaters assumed
if mainheating["has_no_system_present"] or mainheating["has_portable_electric_heaters"] or ( if mainheating["has_no_system_present"] or mainheating["has_portable_electric_heaters"] or (
mainheating["has_warm_air"] and mainheating["has_electric"] and not mainheating["has_electricaire"] mainheating["has_warm_air"] and mainheating["has_electric"] and not mainheating["has_electricaire"]
): ) or mainheating['has_hot-water-only']:
return 'Electric Room Heaters' return 'Electric Room Heaters'
if not any(mainheating.values()): if not any(mainheating.values()):

View file

@ -96,7 +96,7 @@ pre_main_heating_scenarios = [
{ {
"description": "Portable electric heaters assumed for most rooms (maps to electric room heaters)", "description": "Portable electric heaters assumed for most rooms (maps to electric room heaters)",
"MAINHEAT_DESCRIPTION": "Portable electric heaters assumed for most rooms", "MAINHEAT_DESCRIPTION": "Portable electric heaters assumed for most rooms",
"MAIN_FUEL": "mains gas (not community)", # weird in EPCs, but your mapper forces electric room heaters here "MAIN_FUEL": "mains gas (not community)", # weird in EPCs, mapper forces electric room heaters here
"MAINHEAT_ENERGY_EFF": "Very Poor", "MAINHEAT_ENERGY_EFF": "Very Poor",
"expected": "Electric Room Heaters", "expected": "Electric Room Heaters",
}, },

View file

@ -1126,7 +1126,7 @@ for _, x in tqdm(epc_df.iterrows(), total=len(epc_df)):
errored_epcs = epc_df[epc_df["LMK_KEY"].isin(errors)] errored_epcs = epc_df[epc_df["LMK_KEY"].isin(errors)]
unique_combs = errored_epcs[["MAINHEAT_ENERGY_EFF", "MAINHEAT_DESCRIPTION", "MAIN_FUEL"]].drop_duplicates() unique_combs = errored_epcs[["MAINHEAT_ENERGY_EFF", "MAINHEAT_DESCRIPTION", "MAIN_FUEL"]].drop_duplicates()
i = 11 i = 2
x = errored_epcs[ x = errored_epcs[
(errored_epcs["MAINHEAT_ENERGY_EFF"] == unique_combs["MAINHEAT_ENERGY_EFF"].values[i]) & (errored_epcs["MAINHEAT_ENERGY_EFF"] == unique_combs["MAINHEAT_ENERGY_EFF"].values[i]) &
(errored_epcs["MAINHEAT_DESCRIPTION"] == unique_combs["MAINHEAT_DESCRIPTION"].values[i]) & (errored_epcs["MAINHEAT_DESCRIPTION"] == unique_combs["MAINHEAT_DESCRIPTION"].values[i]) &

View file

@ -16,6 +16,7 @@ class MainHeatAttributes(Definitions):
"solar assisted heat pump", "solar assisted heat pump",
"exhaust source heat pump", "exhaust source heat pump",
"community heat pump", "community heat pump",
"hot-water-only"
] ]
FUEL_TYPES = ["electric", "mains gas", "wood logs", "coal", "oil", "wood pellets", "anthracite", FUEL_TYPES = ["electric", "mains gas", "wood logs", "coal", "oil", "wood pellets", "anthracite",
"dual fuel mineral and wood", "smokeless fuel", "lpg", "b30k", "mineral and wood", "dual fuel mineral and wood", "smokeless fuel", "lpg", "b30k", "mineral and wood",
@ -88,6 +89,7 @@ class MainHeatAttributes(Definitions):
"gas-fired heat pumps, electric": "air source heat pump, electric", "gas-fired heat pumps, electric": "air source heat pump, electric",
"radiator heating, heat from boilers - gas": "boiler and radiators, mains gas", "radiator heating, heat from boilers - gas": "boiler and radiators, mains gas",
"heat pump, warm air, mains gas": "air source heat pump, warm air, mains gas", "heat pump, warm air, mains gas": "air source heat pump, warm air, mains gas",
"air sourceheat pump, radiators, electric": "air source heat pump, radiators, electric"
} }
edge_case_result = {} edge_case_result = {}

View file

@ -1738,5 +1738,21 @@ mainheat_cases = [
'has_mineral_and_wood': False, 'has_dual_fuel_appliance': True, 'has_assumed': False, 'has_electricaire': False, 'has_mineral_and_wood': False, 'has_dual_fuel_appliance': True, 'has_assumed': False, 'has_electricaire': False,
'has_assumed_for_most_rooms': False, 'has_underfloor_heating': False 'has_assumed_for_most_rooms': False, 'has_underfloor_heating': False
},
{
"original_description": "Hot-Water-Only Systems, electric",
'has_radiators': False, 'has_fan_coil_units': False, 'has_pipes_in_screed_above_insulation': False,
'has_pipes_in_insulated_timber_floor': False, 'has_pipes_in_concrete_slab': False, 'has_boiler': False,
'has_air_source_heat_pump': False, 'has_room_heaters': False, 'has_electric_storage_heaters': False,
'has_warm_air': False, 'has_electric_underfloor_heating': False, 'has_electric_ceiling_heating': False,
'has_community_scheme': False, 'has_ground_source_heat_pump': False, 'has_no_system_present': False,
'has_portable_electric_heaters': False, 'has_water_source_heat_pump': False, 'has_electric_heat_pump': False,
'has_micro-cogeneration': False, 'has_solar_assisted_heat_pump': False, 'has_exhaust_source_heat_pump': False,
'has_community_heat_pump': False, 'has_hot-water-only': True, 'has_electric': True, 'has_mains_gas': False,
'has_wood_logs': False, 'has_coal': False, 'has_oil': False, 'has_wood_pellets': False, 'has_anthracite': False,
'has_dual_fuel_mineral_and_wood': False, 'has_smokeless_fuel': False, 'has_lpg': False, 'has_b30k': False,
'has_mineral_and_wood': False, 'has_dual_fuel_appliance': False, 'has_assumed': False,
'has_electricaire': False, 'has_assumed_for_most_rooms': False, 'has_underfloor_heating': False
} }
] ]