section 12

This commit is contained in:
Jun-te Kim 2025-03-16 14:57:53 +00:00
parent a724c37c3a
commit 677ba42f2c
2 changed files with 21 additions and 8 deletions

View file

@ -2,7 +2,7 @@ from etl.pdfReader.reportType import ReportType
from transform.types import (
CompanyInfo, SurverySummaryInfo, AssessorInfo,
PropertyDescription, PropertyDetail, Dimension,
Walls, Roofs, Floors, Door
Walls, Roofs, Floors, Door, VentilationAndCooling
)
from datetime import datetime
@ -36,8 +36,12 @@ class QuidosSiteNotesExtractor(SiteNotesExtractor):
"""
self.transform_summary_information()
self.transform_sections()
# Saves windows till the end as that requires thought
# self.get_section_11()
# self.get_section_12()
# start section 12, should just be dict_
# self.get_section_13()
# self.get_section_14()
# self.get_section_14_1()
@ -175,7 +179,7 @@ class QuidosSiteNotesExtractor(SiteNotesExtractor):
# Section 3
age_bands = self.get_age_band()
print()
# Section 4
no_of_main_property = int(get_value("Main Property"))
no_of_extension_1 = int(get_value('Extension 1') or 0)
@ -193,7 +197,6 @@ class QuidosSiteNotesExtractor(SiteNotesExtractor):
# Section 5
conservatory = self.is_there_a_conservatory()
# Section 7
walls = self.get_walls()
@ -206,6 +209,9 @@ class QuidosSiteNotesExtractor(SiteNotesExtractor):
# Section 10
door = self.get_door()
# Section 12
ventilationAndCooling = self.get_ventilation_and_cooling()
self.property_description = PropertyDescription(
built_form = get_value("Built Form"),
detachment_or_position = get_value("Detachment/Position"),
@ -250,6 +256,7 @@ class QuidosSiteNotesExtractor(SiteNotesExtractor):
)if no_of_extension_4 > 0 else None,
conservatory=conservatory,
door=door,
ventilationAndCooling=ventilationAndCooling,
)
@ -583,7 +590,7 @@ class QuidosSiteNotesExtractor(SiteNotesExtractor):
lst.append(dict_)
until = index + 3 + i
def get_section_12(self):
def get_ventilation_and_cooling(self):
data = self.raw_data[self.raw_data.index('12.0 Ventilation & Cooling'): self.raw_data.index('13.0 Lighting')]
avoid = [
'12.0 Ventilation & Cooling',
@ -595,7 +602,12 @@ class QuidosSiteNotesExtractor(SiteNotesExtractor):
"Space Cooling System Present",
]
self.two_columns_processor(data, sub_titles, avoid, 12)
dict_ = self.two_columns_processor(data, sub_titles, avoid)
return VentilationAndCooling(
no_of_open_fireplaces=int(dict_.get("number_of_open_fireplaces", -1)),
ventilation_type=str(dict_.get("ventilation_type", "")),
space_cooling_system_present=True if dict_.get("space_cooling_system_present").upper() == "YES" else False
)
def get_section_13(self):
data = self.raw_data[self.raw_data.index('13.0 Lighting'): self.raw_data.index('14.0 Main Heating1')]

View file

@ -84,7 +84,7 @@ class Windows(BaseModel):
u_value_w_m2_k: int
g_value: int
class FirePlaces(BaseModel):
class VentilationAndCooling(BaseModel):
no_of_open_fireplaces: int
ventilation_type: str
space_cooling_system_present: bool
@ -137,4 +137,5 @@ class PropertyDescription(BaseModel):
ex3_property: Optional[PropertyDetail] = None
ex4_property: Optional[PropertyDetail] = None
conservatory: bool
door: Optional[Door]
door: Optional[Door]
ventilationAndCooling: Optional[VentilationAndCooling]