mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-30 13:10:47 +00:00
extract energy fields from elmhurst site notes 🟩
This commit is contained in:
parent
444eaa0c06
commit
7a68fbcae9
1 changed files with 15 additions and 0 deletions
|
|
@ -368,6 +368,13 @@ class ElmhurstSiteNotesExtractor:
|
||||||
showers=showers,
|
showers=showers,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
def _rating_val(self, label: str) -> int:
|
||||||
|
v = self._next_val(label)
|
||||||
|
try:
|
||||||
|
return int(v.split()[-1]) if v else 0
|
||||||
|
except (ValueError, IndexError):
|
||||||
|
return 0
|
||||||
|
|
||||||
def _extract_renewables(self) -> Renewables:
|
def _extract_renewables(self) -> Renewables:
|
||||||
fghrs_lines = self._section_lines(
|
fghrs_lines = self._section_lines(
|
||||||
"18.0 Flue Gas Heat Recovery System", "19.0 Photovoltaic Panel"
|
"18.0 Flue Gas Heat Recovery System", "19.0 Photovoltaic Panel"
|
||||||
|
|
@ -390,9 +397,17 @@ class ElmhurstSiteNotesExtractor:
|
||||||
)
|
)
|
||||||
|
|
||||||
def extract(self) -> ElmhurstSiteNotes:
|
def extract(self) -> ElmhurstSiteNotes:
|
||||||
|
emissions_raw = self._next_val("Emissions (t/year)")
|
||||||
|
co2 = float(emissions_raw.split()[0]) if emissions_raw else 0.0
|
||||||
|
|
||||||
return ElmhurstSiteNotes(
|
return ElmhurstSiteNotes(
|
||||||
surveyor_info=self._extract_surveyor_info(),
|
surveyor_info=self._extract_surveyor_info(),
|
||||||
property_details=self._extract_property_details(),
|
property_details=self._extract_property_details(),
|
||||||
|
current_sap_rating=self._rating_val("Current SAP rating"),
|
||||||
|
potential_sap_rating=self._rating_val("Potential SAP rating"),
|
||||||
|
current_ei_rating=self._rating_val("Current EI rating"),
|
||||||
|
potential_ei_rating=self._rating_val("Potential EI rating"),
|
||||||
|
co2_emissions_current_t=co2,
|
||||||
property_type=self._str_val("1.0 Property type"),
|
property_type=self._str_val("1.0 Property type"),
|
||||||
attachment=self._extract_attachment(),
|
attachment=self._extract_attachment(),
|
||||||
number_of_storeys=self._int_val("Storeys"),
|
number_of_storeys=self._int_val("Storeys"),
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue