mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-30 13:10:47 +00:00
hndling case where landlord uprn and landlord property id are the sames
This commit is contained in:
parent
47ad0e8275
commit
591ce54458
2 changed files with 12 additions and 3 deletions
|
|
@ -297,6 +297,12 @@ class AssetList:
|
||||||
self.rename_map = {}
|
self.rename_map = {}
|
||||||
self.keep_variables = []
|
self.keep_variables = []
|
||||||
|
|
||||||
|
# Finally, we handle the case where the landlord's property ID is actually the OS UPRN
|
||||||
|
if self.landlord_uprn == self.landlord_property_id:
|
||||||
|
self.raw_asset_list[self.STANDARD_UPRN] = self.raw_asset_list[self.landlord_uprn].copy()
|
||||||
|
# Update the reference to landlord UPRn
|
||||||
|
self.landlord_uprn = self.STANDARD_UPRN
|
||||||
|
|
||||||
def _extract_address1(self, asset_list, full_address_col, postcode_col, method="first_two_words"):
|
def _extract_address1(self, asset_list, full_address_col, postcode_col, method="first_two_words"):
|
||||||
|
|
||||||
if method not in self.ADDRESS_1_CLEANING_METHODS:
|
if method not in self.ADDRESS_1_CLEANING_METHODS:
|
||||||
|
|
|
||||||
|
|
@ -511,6 +511,7 @@ def app():
|
||||||
find_my_epc_data["Solar photovoltaics"] = False
|
find_my_epc_data["Solar photovoltaics"] = False
|
||||||
|
|
||||||
# Retrieve just the data we need
|
# Retrieve just the data we need
|
||||||
|
|
||||||
epc_df = epc_df[
|
epc_df = epc_df[
|
||||||
[
|
[
|
||||||
"row_id",
|
"row_id",
|
||||||
|
|
@ -527,21 +528,23 @@ def app():
|
||||||
"walls-description",
|
"walls-description",
|
||||||
"floor-description",
|
"floor-description",
|
||||||
"transaction-type",
|
"transaction-type",
|
||||||
# New fields needed
|
|
||||||
"secondheat-description",
|
"secondheat-description",
|
||||||
"total-floor-area",
|
"total-floor-area",
|
||||||
"construction-age-band",
|
"construction-age-band",
|
||||||
"floor-height",
|
"floor-height",
|
||||||
"number-habitable-rooms",
|
"number-habitable-rooms",
|
||||||
"mainheat-description",
|
"mainheat-description",
|
||||||
#
|
'mainheatcont-description',
|
||||||
"energy-consumption-current", # kwh/m2
|
"energy-consumption-current",
|
||||||
"photo-supply",
|
"photo-supply",
|
||||||
]
|
]
|
||||||
].rename(
|
].rename(
|
||||||
columns={"address1": "Address1 on EPC", "address": "Address on EPC", "postcode": "Postcode on EPC"}
|
columns={"address1": "Address1 on EPC", "address": "Address on EPC", "postcode": "Postcode on EPC"}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
asset_list.merge_data(epc_df)
|
||||||
|
asset_list.insert_
|
||||||
|
|
||||||
asset_list = asset_list.merge(
|
asset_list = asset_list.merge(
|
||||||
epc_df,
|
epc_df,
|
||||||
how="left",
|
how="left",
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue