Band every continuous SAP score through the published-rating rule 🟪

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Khalim Conn-Kowlessar 2026-07-21 10:11:06 +00:00
parent 07a71ad504
commit 27060f4d81
3 changed files with 6 additions and 6 deletions

View file

@ -91,13 +91,13 @@ class Plan:
@property
def post_epc_rating(self) -> Epc:
"""The post-retrofit EPC band, from the rounded SAP rating."""
return Epc.from_sap_score(round(self.post_retrofit.sap_continuous))
"""The post-retrofit EPC band, as it would be published."""
return Epc.from_sap_continuous(self.post_retrofit.sap_continuous)
@property
def baseline_epc_rating(self) -> Epc:
"""The baseline EPC band, from the rounded baseline SAP rating."""
return Epc.from_sap_score(round(self.baseline.sap_continuous))
"""The baseline EPC band, as it would be published."""
return Epc.from_sap_continuous(self.baseline.sap_continuous)
@property
def valuation(self) -> ValuationUplift:

View file

@ -17,7 +17,7 @@ _KG_PER_TONNE = 1000.0
def _band(sap_continuous: float) -> str:
return Epc.from_sap_score(round(sap_continuous)).value
return Epc.from_sap_continuous(sap_continuous).value
def _signed_gbp(value: Optional[float]) -> str:

View file

@ -52,7 +52,7 @@ def _band_rank(band: Optional[str]) -> Optional[int]:
def _band_of(score: Optional[float]) -> Optional[str]:
if score is None:
return None
return Epc.from_sap_score(round(score)).value
return Epc.from_sap_continuous(score).value
def _int_or_none(value: object) -> Optional[int]: