From 27060f4d8147e30978549443621e5b89fbe17286 Mon Sep 17 00:00:00 2001 From: Khalim Conn-Kowlessar Date: Tue, 21 Jul 2026 10:11:06 +0000 Subject: [PATCH] =?UTF-8?q?Band=20every=20continuous=20SAP=20score=20throu?= =?UTF-8?q?gh=20the=20published-rating=20rule=20=F0=9F=9F=AA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 4.8 (1M context) --- domain/modelling/plan.py | 8 ++++---- harness/plan_table.py | 2 +- scripts/audit/anomalies.py | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/domain/modelling/plan.py b/domain/modelling/plan.py index 9e8349e9d..bd14da3af 100644 --- a/domain/modelling/plan.py +++ b/domain/modelling/plan.py @@ -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: diff --git a/harness/plan_table.py b/harness/plan_table.py index 7c6e96f1a..ddb5d2513 100644 --- a/harness/plan_table.py +++ b/harness/plan_table.py @@ -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: diff --git a/scripts/audit/anomalies.py b/scripts/audit/anomalies.py index 0ee0386d4..7d8f1b11a 100644 --- a/scripts/audit/anomalies.py +++ b/scripts/audit/anomalies.py @@ -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]: