mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
Merge pull request #517 from Hestia-Homes/eco-eligiblity-bug
Eco eligiblity bug
This commit is contained in:
commit
21741d9721
5 changed files with 61 additions and 12 deletions
|
|
@ -59,6 +59,40 @@ def app():
|
|||
Property UPRN
|
||||
"""
|
||||
|
||||
# Stonewater Solar
|
||||
data_folder = "/Users/khalimconn-kowlessar/Documents/hestia/Customers/Stonewater/October 2025 Solar"
|
||||
data_filename = "Copy of AP Stonewater Ammended address list - PV AM Amended - Khalim initial review.xlsx"
|
||||
sheet_name = "Proposed Sheet"
|
||||
postcode_column = 'Postcode'
|
||||
address1_column = None
|
||||
address1_method = "house_number_extraction"
|
||||
fulladdress_column = "Address"
|
||||
address_cols_to_concat = []
|
||||
missing_postcodes_method = None
|
||||
landlord_year_built = None
|
||||
landlord_os_uprn = None
|
||||
landlord_property_type = "Property Type"
|
||||
landlord_built_form = "Property Type"
|
||||
landlord_wall_construction = "Walls"
|
||||
landlord_roof_construction = "Roofs"
|
||||
landlord_heating_system = "Heating"
|
||||
landlord_existing_pv = None
|
||||
landlord_property_id = "Asset Id"
|
||||
landlord_sap = "SAP"
|
||||
outcomes_filename = None
|
||||
outcomes_sheetname = None
|
||||
outcomes_postcode = None
|
||||
outcomes_houseno = None
|
||||
outcomes_id = None
|
||||
outcomes_address = None
|
||||
master_filepaths = []
|
||||
master_id_colnames = []
|
||||
master_to_asset_list_filepath = None
|
||||
phase = False
|
||||
ecosurv_landlords = None
|
||||
asset_list_header = 0
|
||||
landlord_block_reference = None
|
||||
|
||||
#
|
||||
data_folder = "/Users/khalimconn-kowlessar/Documents/hestia/Customers/Cambridge/"
|
||||
data_filename = "22.10_Cambridge_west addresses.xlsx"
|
||||
|
|
|
|||
|
|
@ -456,6 +456,8 @@ BUILT_FORM_MAPPINGS = {
|
|||
'House: Mid Terrace: Ground Floor': 'ground floor',
|
||||
'Maisonette: Semi Detached: Mid Floor': 'detached',
|
||||
'Maisonette: Detached: Mid Floor': 'detached',
|
||||
'Bungalow: EnclosedMidTerrace': 'enclosed mid-terrace'
|
||||
'Bungalow: EnclosedMidTerrace': 'enclosed mid-terrace',
|
||||
|
||||
'House: EnclosedMidTerrace': 'enclosed mid-terrace'
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -360,6 +360,8 @@ PROPERTY_MAPPING = {
|
|||
'House: Mid Terrace: Ground Floor': 'house',
|
||||
'Bungalow: EnclosedMidTerrace': 'bungalow',
|
||||
'Maisonette: Semi Detached: Mid Floor': 'maisonette',
|
||||
'Maisonette: Detached: Mid Floor': 'maisonette'
|
||||
'Maisonette: Detached: Mid Floor': 'maisonette',
|
||||
|
||||
'House: EnclosedMidTerrace': 'house'
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -718,15 +718,26 @@ class RetrieveFindMyEpc:
|
|||
find_epc_data = searcher.retrieve_newest_find_my_epc_data()
|
||||
except Exception as e:
|
||||
logger.error(f"Error retrieving find my epc data: {e}")
|
||||
if epc["address1"] == epc["address"]:
|
||||
# There's no benefit of using the same address, so we split on comma
|
||||
address1 = epc["address"].split(",")[0]
|
||||
else:
|
||||
address1 = epc["address1"]
|
||||
# We attempt with the backup add
|
||||
searcher = cls(address=address1, postcode=epc["postcode"])
|
||||
find_epc_data = searcher.retrieve_newest_find_my_epc_data()
|
||||
logger.info("Successfully retrieved find my epc data using backup address")
|
||||
|
||||
# We try two backup approaches. The first is to trim the final section off the end of the address
|
||||
address1 = ",".join(epc["address"].split(",")[:-1])
|
||||
try:
|
||||
searcher = cls(address=address1, postcode=epc["postcode"])
|
||||
find_epc_data = searcher.retrieve_newest_find_my_epc_data()
|
||||
logger.info("Successfully retrieved find my epc data using trimmed address")
|
||||
except Exception as e2:
|
||||
logger.error(f"Error retrieving find my epc data using trimmed address: {e2}")
|
||||
# Attempt final approach
|
||||
|
||||
if epc["address1"] == epc["address"]:
|
||||
# There's no benefit of using the same address, so we split on comma
|
||||
address1 = epc["address"].split(",")[0]
|
||||
else:
|
||||
address1 = epc["address1"]
|
||||
# We attempt with the backup add
|
||||
searcher = cls(address=address1, postcode=epc["postcode"])
|
||||
find_epc_data = searcher.retrieve_newest_find_my_epc_data()
|
||||
logger.info("Successfully retrieved find my epc data using backup address")
|
||||
|
||||
non_invasive_recommendations = {
|
||||
"uprn": epc["uprn"],
|
||||
|
|
|
|||
|
|
@ -896,7 +896,7 @@ def make_funding_paths(p, input_measures, housing_type, funding: Funding):
|
|||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
# 1) The package must include EWI or IWI if the property is private rental sector
|
||||
# We check if we have any EWI or IWI measures available - only for EPC E or below
|
||||
if p.data["current-energy-rating"] not in ["E", "F", "G"]:
|
||||
if p.data["current-energy-rating"] in ["E", "F", "G"]:
|
||||
ewi_or_iwi = [{"OR": []}]
|
||||
reference_measures = []
|
||||
# If we have EWI we add it in
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue