mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
working on solar criteria
This commit is contained in:
parent
4db9d48e36
commit
c544c95282
2 changed files with 96 additions and 17 deletions
|
|
@ -936,9 +936,6 @@ class AssetList:
|
|||
# Solar
|
||||
######################################################
|
||||
# Criteria:
|
||||
|
||||
# TODO: Standardise these columns with our cleaned_data object
|
||||
|
||||
# Check 1: Does the property have a valid heating system?
|
||||
self.standardised_asset_list["solar_landlord_data_indicates_correct_heating_system"] = (
|
||||
self.standardised_asset_list[self.STANDARD_HEATING_SYSTEM].isin(
|
||||
|
|
@ -993,9 +990,35 @@ class AssetList:
|
|||
)
|
||||
|
||||
# TODO: We don't have information about the roof from this landlord
|
||||
|
||||
# We merge on the u-value for average thermal transmittance
|
||||
walls_uvalue_data = pd.DataFrame(cleaned["walls-description"])
|
||||
walls_uvalue_data = walls_uvalue_data[
|
||||
~pd.isnull(walls_uvalue_data["thermal_transmittance"])
|
||||
][["original_description", "thermal_transmittance"]].rename(
|
||||
columns={
|
||||
"original_description": self.EPC_API_DATA_NAMES["walls-description"],
|
||||
"thermal_transmittance": "walls_u_value"
|
||||
}
|
||||
)
|
||||
self.standardised_asset_list = self.standardised_asset_list.merge(
|
||||
walls_uvalue_data, how="left", on=self.EPC_API_DATA_NAMES["walls-description"]
|
||||
)
|
||||
|
||||
self.standardised_asset_list["solar_epc_walls_insulated"] = (
|
||||
self.standardised_asset_list[self.EPC_API_DATA_NAMES["walls-description"]].str.lower().str.contains(
|
||||
"|".join(self.EPC_INSULATED_WALLS_SUBSTRINGS)
|
||||
(
|
||||
self.standardised_asset_list[
|
||||
self.EPC_API_DATA_NAMES[
|
||||
"walls-description"]].str.lower().str.contains(
|
||||
"|".join(
|
||||
self.EPC_INSULATED_WALLS_SUBSTRINGS)
|
||||
)
|
||||
) | (
|
||||
self.standardised_asset_list[
|
||||
"walls_u_value"].apply(
|
||||
lambda x: x <= 0.3 if not pd.isnull(
|
||||
x) else False
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
|
|
@ -1034,13 +1057,69 @@ class AssetList:
|
|||
lambda x: int(x) < 270 if str(x).isdigit() else False
|
||||
)
|
||||
|
||||
self.standardised_asset_list["solar_epc_floor_is_solid"] = self.standardised_asset_list[
|
||||
self.EPC_API_DATA_NAMES["floor-description"]
|
||||
].str.lower().str.contains("solid")
|
||||
self.standardised_asset_list["solar_epc_floor_is_solid"] = (
|
||||
self.standardised_asset_list["solar_epc_floor_is_solid"].fillna(False)
|
||||
# TODO: Fill with False - should be temp!
|
||||
self.standardised_asset_list["epc_has_floor_recommendation"] = (
|
||||
self.standardised_asset_list["epc_has_floor_recommendation"].fillna(False)
|
||||
)
|
||||
|
||||
z = self.standardised_asset_list[
|
||||
self.standardised_asset_list["solar_epc_floor_is_solid"] == True
|
||||
]
|
||||
self.standardised_asset_list["solar_epc_floor_is_solid_no_recommendation"] = (
|
||||
(
|
||||
(
|
||||
self.standardised_asset_list[self.EPC_API_DATA_NAMES["floor-description"]].str
|
||||
.lower().str.contains("solid")
|
||||
) & (
|
||||
~self.standardised_asset_list["epc_has_floor_recommendation"]
|
||||
)
|
||||
) | (
|
||||
(
|
||||
self.standardised_asset_list[self.EPC_API_DATA_NAMES["floor-description"]].str.contains("solid")
|
||||
) & (
|
||||
self.standardised_asset_list[self.EPC_API_DATA_NAMES["floor-description"]].str.lower()
|
||||
.str.contains(", insulated")
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
# We now put together the criteria:
|
||||
# Flag properties that look eligible for solar, that have solid floors
|
||||
# TODO: We'll need to revise this
|
||||
self.standardised_asset_list["solar_eligible_solid_floor"] = (
|
||||
# Landlord data or EPC data indicates the heating system is appropriate
|
||||
(
|
||||
self.standardised_asset_list["solar_landlord_data_indicates_correct_heating_system"] |
|
||||
self.standardised_asset_list["solar_epc_data_indicates_correct_heating_system"]
|
||||
) &
|
||||
# The property doesn't currently have solar
|
||||
~self.standardised_asset_list["property_has_solar"] &
|
||||
# The walls are insulated
|
||||
(
|
||||
self.standardised_asset_list["solar_landlord_walls_insulated"] |
|
||||
self.standardised_asset_list["solar_epc_walls_insulated"]
|
||||
) &
|
||||
# Roof is insulated
|
||||
self.standardised_asset_list["solar_epc_roof_insulated"] &
|
||||
self.standardised_asset_list["solar_epc_floor_is_solid_no_recommendation"]
|
||||
)
|
||||
|
||||
# Solid floor but needs a loft top-up
|
||||
self.standardised_asset_list["solar_eligible_solid_floor_needs_loft"] = (
|
||||
# Landlord data or EPC data indicates the heating system is appropriate
|
||||
(
|
||||
self.standardised_asset_list["solar_landlord_data_indicates_correct_heating_system"] |
|
||||
self.standardised_asset_list["solar_epc_data_indicates_correct_heating_system"]
|
||||
) &
|
||||
# The property doesn't currently have solar
|
||||
~self.standardised_asset_list["property_has_solar"] &
|
||||
# The walls are insulated
|
||||
(
|
||||
self.standardised_asset_list["solar_landlord_walls_insulated"] |
|
||||
self.standardised_asset_list["solar_epc_walls_insulated"]
|
||||
) &
|
||||
# Roof is insulated
|
||||
self.standardised_asset_list["solar_epc_loft_needs_topup"] &
|
||||
self.standardised_asset_list["solar_epc_floor_is_solid_no_recommendation"]
|
||||
)
|
||||
|
||||
# Suspended floor, fully insulated
|
||||
|
||||
# ~self.standardised_asset_list["solar_epc_loft_needs_topup"] &
|
||||
|
|
|
|||
|
|
@ -389,11 +389,9 @@ def app():
|
|||
transformed_data.append(row_data)
|
||||
|
||||
transformed_df = pd.DataFrame(transformed_data)
|
||||
# At the moment, we're only using a limited set of columns - let's jut keep cavity wall insulation
|
||||
# recommendations
|
||||
transformed_df = transformed_df[
|
||||
[
|
||||
asset_list.DOMNA_PROPERTY_ID, "Cavity wall insulation", "Floor insulation (solid floor)",
|
||||
asset_list.DOMNA_PROPERTY_ID, "Floor insulation (solid floor)",
|
||||
"Floor insulation", "Floor insulation (suspended floor)"
|
||||
]
|
||||
]
|
||||
|
|
@ -425,7 +423,9 @@ def app():
|
|||
)
|
||||
|
||||
epc_df = epc_df.merge(
|
||||
find_my_epc_data[[asset_list.DOMNA_PROPERTY_ID] + list(asset_list.FIND_EPC_DATA_NAMES.keys())]
|
||||
find_my_epc_data[
|
||||
[asset_list.DOMNA_PROPERTY_ID, "epc_has_floor_recommendation"] + list(asset_list.FIND_EPC_DATA_NAMES.keys())
|
||||
]
|
||||
.rename(columns=asset_list.FIND_EPC_DATA_NAMES),
|
||||
how="left",
|
||||
on=asset_list.DOMNA_PROPERTY_ID
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue