mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
debuggin xml extraction
This commit is contained in:
parent
323364e0df
commit
8f8e85c1e1
1 changed files with 13 additions and 5 deletions
|
|
@ -113,6 +113,7 @@ class XmlParser:
|
|||
}
|
||||
|
||||
GLAZED_AREA_MAP = {
|
||||
"2": "More than Typical",
|
||||
"4": "Much More Than Typical"
|
||||
}
|
||||
|
||||
|
|
@ -121,7 +122,8 @@ class XmlParser:
|
|||
}
|
||||
|
||||
TRANSACTION_TYPE_MAP = {
|
||||
"13": "ECO assessment"
|
||||
"13": "ECO assessment",
|
||||
"14": "Stock condition survey",
|
||||
}
|
||||
|
||||
TENURE_MAP = {
|
||||
|
|
@ -401,8 +403,13 @@ class XmlParser:
|
|||
]
|
||||
|
||||
wall_areas = sum([float(f["heat_loss_perimeter"]) * float(f["room_height"]) for f in main_dwelling_floors])
|
||||
window_areas = sum([float(w["window_area"]) for w in main_dwelling_windows])
|
||||
return wall_areas - window_areas
|
||||
window_areas = [float(w["window_area"]) for w in main_dwelling_windows if w["window_area"] is not None]
|
||||
if not window_areas:
|
||||
# We discount 10% of the wall area
|
||||
insulation_wall_area = wall_areas * 0.9
|
||||
else:
|
||||
insulation_wall_area = wall_areas - window_areas
|
||||
return insulation_wall_area
|
||||
|
||||
def extract_additional_data(self):
|
||||
|
||||
|
|
@ -416,7 +423,8 @@ class XmlParser:
|
|||
main_dwelling_windows = [w for w in self.windows if w["window_location"] == "0"]
|
||||
|
||||
number_of_windows = len(main_dwelling_windows)
|
||||
windows_area = sum([float(w["window_area"]) for w in main_dwelling_windows])
|
||||
windows_area = [float(w["window_area"]) for w in main_dwelling_windows if w["window_area"] is not None]
|
||||
windows_area = sum(windows_area) if windows_area else None
|
||||
|
||||
boolean_lookup = {
|
||||
"true": True,
|
||||
|
|
@ -462,7 +470,7 @@ class XmlParser:
|
|||
"cylinder_thermostat": cylinder_thermostat,
|
||||
"main_dwelling_ground_floor_area": float(main_dwelling_ground_floor_area),
|
||||
"number_of_windows": int(number_of_windows),
|
||||
"windows_area": float(windows_area),
|
||||
"windows_area": float(windows_area) if windows_area is not None else windows_area,
|
||||
}
|
||||
|
||||
def get_node_value(self, tag_name):
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue