mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-07-12 13:29:04 +00:00
savings
This commit is contained in:
parent
5ac5cd7737
commit
4e41993455
2 changed files with 2 additions and 17 deletions
|
|
@ -1,18 +1,7 @@
|
||||||
import os
|
|
||||||
|
|
||||||
import pandas as pd
|
import pandas as pd
|
||||||
from tqdm import tqdm
|
|
||||||
|
|
||||||
from dotenv import load_dotenv
|
|
||||||
from utils.s3 import read_excel_from_s3
|
from utils.s3 import read_excel_from_s3
|
||||||
from backend.SearchEpc import SearchEpc
|
|
||||||
from epc_api.client import EpcClient
|
|
||||||
from utils.s3 import save_csv_to_s3
|
from utils.s3 import save_csv_to_s3
|
||||||
|
|
||||||
# Read in the .env file in backend
|
|
||||||
load_dotenv(dotenv_path="backend/.env")
|
|
||||||
EPC_AUTH_TOKEN = os.getenv("EPC_AUTH_TOKEN")
|
|
||||||
|
|
||||||
USER_ID = 8
|
USER_ID = 8
|
||||||
PORTFOLIO_ID = 70
|
PORTFOLIO_ID = 70
|
||||||
|
|
||||||
|
|
@ -28,6 +17,7 @@ council_tax_bands = [
|
||||||
{'address': '6 Beech Road', 'postcode': 'DY1 4BP', 'band': 'A'},
|
{'address': '6 Beech Road', 'postcode': 'DY1 4BP', 'band': 'A'},
|
||||||
{'address': '5 Oaklands', 'postcode': 'B62 0JA', 'band': 'A'},
|
{'address': '5 Oaklands', 'postcode': 'B62 0JA', 'band': 'A'},
|
||||||
]
|
]
|
||||||
|
council_tax_bands = pd.DataFrame(council_tax_bands)
|
||||||
|
|
||||||
|
|
||||||
def app():
|
def app():
|
||||||
|
|
@ -41,7 +31,6 @@ def app():
|
||||||
raw_asset_list["address"] = raw_asset_list["Full Address"].str.split(",").str[0]
|
raw_asset_list["address"] = raw_asset_list["Full Address"].str.split(",").str[0]
|
||||||
raw_asset_list["postcode"] = raw_asset_list["Full Address"].str.split(",").str[-1].str.strip()
|
raw_asset_list["postcode"] = raw_asset_list["Full Address"].str.split(",").str[-1].str.strip()
|
||||||
|
|
||||||
council_tax_bands = pd.DataFrame(council_tax_bands)
|
|
||||||
asset_list = raw_asset_list.merge(council_tax_bands, how="left", on=["address", "postcode"])
|
asset_list = raw_asset_list.merge(council_tax_bands, how="left", on=["address", "postcode"])
|
||||||
|
|
||||||
# Store the data in s3
|
# Store the data in s3
|
||||||
|
|
|
||||||
|
|
@ -20,10 +20,6 @@ def prepare_input_measures(property_recommendations, goal, housing_type):
|
||||||
if not goal_key:
|
if not goal_key:
|
||||||
raise NotImplementedError("Not implemented this gain type - investigate me")
|
raise NotImplementedError("Not implemented this gain type - investigate me")
|
||||||
|
|
||||||
# We don't include suspended and solid floor insulation as possible measures in private housing, because
|
|
||||||
# of the need to decant the tenant
|
|
||||||
ignored_measures = ["suspended_floor_insulation", "solid_floor_insulation"] if housing_type == "Private" else []
|
|
||||||
|
|
||||||
input_measures = []
|
input_measures = []
|
||||||
for recs in property_recommendations:
|
for recs in property_recommendations:
|
||||||
input_measures.append(
|
input_measures.append(
|
||||||
|
|
@ -34,7 +30,7 @@ def prepare_input_measures(property_recommendations, goal, housing_type):
|
||||||
"gain": rec[goal_key],
|
"gain": rec[goal_key],
|
||||||
"type": rec["type"]
|
"type": rec["type"]
|
||||||
}
|
}
|
||||||
for rec in recs if rec["type"] not in ignored_measures
|
for rec in recs
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue