Debugging lighting and heating

This commit is contained in:
Khalim Conn-Kowlessar 2023-09-07 16:03:41 +03:00
parent 71dad618ba
commit e7bd4be0b0
3 changed files with 12 additions and 0 deletions

View file

@ -30,6 +30,9 @@ class LightingAttributes:
if "all fixed outlets" in description:
return {"low_energy_proportion": 1}
if "excellent lighting efficiency" in description:
return {"low_energy_proportion": 1}
if ('good lighting efficiency' in description) or ('excellent lighting efficiency' in description) or \
('below average lighting efficiency' in description):
average = [

View file

@ -24,6 +24,10 @@ class MainHeatAttributes(Definitions):
"bwyler a rheiddiaduron, nwy prif gyflenwad": "boiler and radiators, mains gas",
}
REMAP = {
"electric ceiling": "electric ceiling heating"
}
def __init__(self, description: str):
self.description = switch_chars(description.lower())
@ -37,6 +41,10 @@ class MainHeatAttributes(Definitions):
self.nodata = False
self.description = translation
remap = self.REMAP.get(self.description)
if remap:
self.description = remap
if not description or not any(
rt in self.description for rt in
self.HEAT_SYSTEMS + self.FUEL_TYPES + self.DISTRIBUTION_SYSTEMS + self.OTHERS

View file

@ -33,4 +33,5 @@ test_cases = [
{'original_description': 'Goleuadau ynni-isel mewn 60% oGÇÖr mannau gosod', 'low_energy_proportion': 0.6},
{'original_description': 'Goleuadau ynni-isel ym mhob un oGÇÖr mannau gosod', 'low_energy_proportion': 1},
{'original_description': 'Dim goleuadau ynni-isel', 'low_energy_proportion': 0},
{'original_description': 'Excellent lighting efficiency', 'low_energy_proportion': 1},
]