Model/datatypes/address_match.py
Jun-te Kim dbcdf29bd9 refactor(address2uprn): name the match/decision return types; rename helper
Address PR review (dancafc):
- introduce UprnMatch NamedTuple (datatypes/address_match.py) for the
  (uprn, address, lexiscore, certificate_number) return, replacing the bare
  4-tuple in get_uprn_from_epc_df / get_uprn_from_historic_epc /
  HistoricEpcResolver.resolve_uprn. Tuple-compatible, so unpacking is unchanged.
- rename get_uprn_with_epc_df -> get_uprn_from_epc_df (+ callers).
- type resolve_group_ambiguity via a GroupDecision NamedTuple and trim its
  docstring.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-07 16:00:00 +00:00

13 lines
346 B
Python

from __future__ import annotations
from typing import NamedTuple, Optional
class UprnMatch(NamedTuple):
"""A confident address→UPRN match from either EPC source (new API or
historic). Tuple-compatible, so existing unpacking keeps working."""
uprn: str
address: str
lexiscore: float
certificate_number: Optional[str]