mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-30 13:10:47 +00:00
made tests pass and redploy
This commit is contained in:
parent
3bdd4a4a97
commit
c2f29e86df
3 changed files with 12 additions and 10 deletions
3
.github/workflows/deploy_terraform.yml
vendored
3
.github/workflows/deploy_terraform.yml
vendored
|
|
@ -204,3 +204,6 @@ jobs:
|
||||||
AWS_ACCESS_KEY_ID: ${{ secrets.DEV_AWS_ACCESS_KEY_ID }}
|
AWS_ACCESS_KEY_ID: ${{ secrets.DEV_AWS_ACCESS_KEY_ID }}
|
||||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.DEV_AWS_SECRET_ACCESS_KEY }}
|
AWS_SECRET_ACCESS_KEY: ${{ secrets.DEV_AWS_SECRET_ACCESS_KEY }}
|
||||||
AWS_REGION: ${{ secrets.DEV_AWS_REGION }}
|
AWS_REGION: ${{ secrets.DEV_AWS_REGION }}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -329,6 +329,7 @@ def get_uprn_candidates(
|
||||||
def get_uprn_with_epc_df(
|
def get_uprn_with_epc_df(
|
||||||
user_inputed_address: str,
|
user_inputed_address: str,
|
||||||
epc_df: pd.DataFrame,
|
epc_df: pd.DataFrame,
|
||||||
|
verbose=False,
|
||||||
):
|
):
|
||||||
"""
|
"""
|
||||||
Return uprn (str) using a pre-fetched EPC dataframe.
|
Return uprn (str) using a pre-fetched EPC dataframe.
|
||||||
|
|
@ -377,15 +378,16 @@ def get_uprn_with_epc_df(
|
||||||
if found_uprn == "":
|
if found_uprn == "":
|
||||||
return None
|
return None
|
||||||
|
|
||||||
return (found_uprn, address, score)
|
if verbose:
|
||||||
|
return (found_uprn, address, score)
|
||||||
|
else:
|
||||||
|
return found_uprn
|
||||||
|
|
||||||
|
|
||||||
def get_uprn(
|
def get_uprn(
|
||||||
user_inputed_address: str,
|
user_inputed_address: str,
|
||||||
postcode: str,
|
postcode: str,
|
||||||
return_address=False,
|
verbose=False,
|
||||||
return_EPC=False,
|
|
||||||
return_score=True,
|
|
||||||
):
|
):
|
||||||
"""
|
"""
|
||||||
Return uprn (str)
|
Return uprn (str)
|
||||||
|
|
@ -400,9 +402,7 @@ def get_uprn(
|
||||||
return get_uprn_with_epc_df(
|
return get_uprn_with_epc_df(
|
||||||
user_inputed_address=user_inputed_address,
|
user_inputed_address=user_inputed_address,
|
||||||
epc_df=df,
|
epc_df=df,
|
||||||
return_address=return_address,
|
verbose=verbose,
|
||||||
return_EPC=return_EPC,
|
|
||||||
return_score=return_score,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -727,8 +727,7 @@ def handler(event, context, local=False):
|
||||||
|
|
||||||
# Get UPRN using the pre-fetched EPC data with all return options
|
# Get UPRN using the pre-fetched EPC data with all return options
|
||||||
result = get_uprn_with_epc_df(
|
result = get_uprn_with_epc_df(
|
||||||
user_inputed_address=user_input,
|
user_inputed_address=user_input, epc_df=epc_df, verbose=True
|
||||||
epc_df=epc_df,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
# Parse result tuple if successful
|
# Parse result tuple if successful
|
||||||
|
|
|
||||||
|
|
@ -168,7 +168,7 @@ def handler(event, context, local=False):
|
||||||
# TODO: DELETE ME, if you see this in the PR.
|
# TODO: DELETE ME, if you see this in the PR.
|
||||||
# TODO: DELETE ME, if you see this in the PR.
|
# TODO: DELETE ME, if you see this in the PR.
|
||||||
# TODO: DELETE ME, if you see this in the PR.
|
# TODO: DELETE ME, if you see this in the PR.
|
||||||
df = df.head(5)
|
df = df.head(1983)
|
||||||
|
|
||||||
logger.info(f"CSV loaded: {len(df)} rows, {len(df.columns)} columns")
|
logger.info(f"CSV loaded: {len(df)} rows, {len(df.columns)} columns")
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue