mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
Merge branch 'main' into deploy-fastapi-with-terraform
This commit is contained in:
commit
fe1de0c6ce
4 changed files with 13 additions and 19 deletions
|
|
@ -73,25 +73,25 @@ def app():
|
|||
Property UPRN
|
||||
"""
|
||||
|
||||
data_folder = "/Users/khalimconn-kowlessar/Documents/hestia/Customers/Lifespace Rentals/Missed"
|
||||
data_folder = "/workspaces/model/asset_list"
|
||||
# data_filename = "For Modelling - Final - reviewed.xlsx"
|
||||
data_filename = "Missed Properties - with address.xlsx"
|
||||
data_filename = "assests.xlsx"
|
||||
sheet_name = "Sheet1"
|
||||
postcode_column = "Postcode"
|
||||
address1_column = "address1"
|
||||
postcode_column = "POSTCODE"
|
||||
address1_column = "ADDRESS"
|
||||
address1_method = None
|
||||
fulladdress_column = "address1"
|
||||
fulladdress_column = "ADDRESS"
|
||||
address_cols_to_concat = []
|
||||
missing_postcodes_method = None
|
||||
landlord_year_built = None
|
||||
landlord_os_uprn = "UPRN"
|
||||
landlord_property_type = "Type"
|
||||
landlord_os_uprn = None
|
||||
landlord_property_type = None
|
||||
landlord_built_form = None
|
||||
landlord_wall_construction = None
|
||||
landlord_roof_construction = None
|
||||
landlord_heating_system = None
|
||||
landlord_existing_pv = None
|
||||
landlord_property_id = "Reference"
|
||||
landlord_property_id = "UPRN"
|
||||
landlord_sap = None
|
||||
outcomes_filename = None
|
||||
outcomes_sheetname = None
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ from pydantic import ValidationError
|
|||
import requests
|
||||
import pandas as pd
|
||||
from utils.logger import setup_logger
|
||||
from backend.ordnanceSurvey.types import PostcodeResponse
|
||||
|
||||
logger = setup_logger()
|
||||
|
||||
|
|
|
|||
|
|
@ -14,8 +14,7 @@ payload = {
|
|||
{
|
||||
"task_id": "e31f2f21-175b-4a91-a3ec-a6baa325e917",
|
||||
"sub_task_id": "8673913b-1a88-42d7-8578-0449123d94b0",
|
||||
"s3_uri": "s3://retrofit-data-dev/ara_raw_outputs/e31f2f21-175b-4a91-a3ec-a6baa325e917/6a427b6e-1ece-4983-b1e5-9bffccc53d1d/2026-03-04T16:48:22.339995_634c88fc.csv",
|
||||
"lexiscore_column": "address2uprn_lexiscore",
|
||||
"s3_uri": "s3://retrofit-data-dev/ara_raw_inputs/calico/missinguprn.csv",
|
||||
}
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ from utils.s3 import (
|
|||
from backend.utils.addressMatch import AddressMatch
|
||||
from backend.app.db.connection import get_db_session
|
||||
from backend.app.db.models.postcode_search import PostcodeSearchModel
|
||||
from backend.utils.ordnance_survey import (
|
||||
from backend.ordnanceSurvey.helpers import (
|
||||
lookup_os_places,
|
||||
os_places_results_to_dataframe,
|
||||
)
|
||||
|
|
@ -60,13 +60,6 @@ def check_if_post_code_exists_in_db_cache(postcode):
|
|||
return os_places_results_to_dataframe(response["data"])
|
||||
|
||||
|
||||
def get_ordance_survey_record(row, cache=None):
|
||||
if cache is None:
|
||||
cache = check_if_post_code_exists_in_db_cache(postcode)
|
||||
|
||||
# process cache with row
|
||||
|
||||
|
||||
def save_results_to_s3(
|
||||
results_df: pd.DataFrame,
|
||||
task_id: str,
|
||||
|
|
@ -211,6 +204,9 @@ def handler(body: dict[str, Any], context: Any, local: bool = False) -> None:
|
|||
best_idx = scores.idxmax()
|
||||
best_score = scores[best_idx]
|
||||
|
||||
if best_score <= 0:
|
||||
continue
|
||||
|
||||
df.at[idx, "ordnance_survey_address"] = postcode_cache.at[
|
||||
best_idx, "ADDRESS"
|
||||
]
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue