added logger and verbose

This commit is contained in:
Jun-te Kim 2026-02-16 13:49:49 +00:00
parent 62a8f543f6
commit ed8d562917

View file

@ -333,6 +333,7 @@ def get_uprn_candidates(
def get_uprn_with_epc_df(
user_inputed_address: str,
epc_df: pd.DataFrame,
verbose: bool = False,
):
"""
Return uprn (str) using a pre-fetched EPC dataframe.
@ -363,7 +364,7 @@ def get_uprn_with_epc_df(
address = top_rank_df["address"].values[0]
score = float(top_rank_df["lexiscore"].values[0])
# logger.info(f"Address found to be: {address}, with lexiscore {lexiscore}")
logger.info(f"Address found to be: {address}, with lexiscore {score}")
# Safe to return the agreed UPRN
found_uprn = top_rank_df.iloc[0]["uprn"]
@ -379,7 +380,7 @@ def get_uprn_with_epc_df(
def get_uprn(
user_inputed_address: str,
postcode: str,
verbose=False,
verbose: bool = False,
):
"""
Return uprn (str)