mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
debugging roof attributes and adding additional test
This commit is contained in:
parent
347e2c5617
commit
09515bd0c5
2 changed files with 16 additions and 2 deletions
|
|
@ -8,6 +8,10 @@ class RoofAttributes(BaseUtility):
|
|||
ROOF_TYPES = ['pitched', 'roof room', 'loft', 'flat', 'thatched', 'at rafters', 'assumed']
|
||||
DWELLING_ABOVE = ["another dwelling above", "other premises above"]
|
||||
|
||||
WELSH_TEXT = {
|
||||
"ar oleddf, dim inswleiddio": "pitched, no insulation",
|
||||
}
|
||||
|
||||
def __init__(self, description: str):
|
||||
"""
|
||||
:param description: Description of the roof.
|
||||
|
|
@ -15,7 +19,12 @@ class RoofAttributes(BaseUtility):
|
|||
|
||||
self.description: str = description.lower()
|
||||
self.nodata = not description or description in self.DATA_ANOMALY_MATCHES
|
||||
|
||||
|
||||
translation = self.WELSH_TEXT.get(self.description)
|
||||
if translation:
|
||||
self.nodata = False
|
||||
self.description = translation
|
||||
|
||||
if not self.nodata and not any(
|
||||
rt in self.description for rt in self.ROOF_TYPES + self.DWELLING_ABOVE + ["average thermal transmittance"]
|
||||
):
|
||||
|
|
|
|||
|
|
@ -344,5 +344,10 @@ clean_roof_test_cases = [
|
|||
{'original_description': 'Thatched, with additional insulation', 'thermal_transmittance': None,
|
||||
'thermal_transmittance_unit': None, 'is_pitched': False, 'is_roof_room': False, 'is_loft': False, 'is_flat': False,
|
||||
'is_thatched': True, 'is_at_rafters': False, 'is_assumed': False, 'has_dwelling_above': False, 'is_valid': True,
|
||||
'insulation_thickness': 'above average'}
|
||||
'insulation_thickness': 'above average'},
|
||||
{'original_description': 'Ar oleddf, dim inswleiddio', 'thermal_transmittance': None,
|
||||
'thermal_transmittance_unit': None,
|
||||
'is_pitched': True, 'is_roof_room': False, 'is_loft': False, 'is_flat': False, 'is_thatched': False,
|
||||
'is_at_rafters': False, 'is_assumed': False, 'has_dwelling_above': False, 'is_valid': True,
|
||||
'insulation_thickness': 'none'}
|
||||
]
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue