mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
fixing missed unit for pulling out u-values
This commit is contained in:
parent
9bbb688a28
commit
5cfa3d291f
2 changed files with 12 additions and 4 deletions
|
|
@ -2,8 +2,9 @@ import re
|
|||
import string
|
||||
from typing import Tuple, Union, Dict, List
|
||||
|
||||
THERMAL_TRANSMITTENCE_STR = r"average thermal transmittance (-?\d+\.\d+)\s(w/m-¦k)"
|
||||
THERMAL_TRANSMITTANCE_REGEX = re.compile(THERMAL_TRANSMITTENCE_STR)
|
||||
THERMAL_TRANSMITTANCE_STR = r"average thermal transmittance (-?\d+\.\d+)\s(w/m\S+k)"
|
||||
THERMAL_TRANSMITTANCE_REGEX = re.compile(THERMAL_TRANSMITTANCE_STR)
|
||||
|
||||
DOUBLE_SPACE_PATTERN = re.compile(r"\s+")
|
||||
|
||||
|
||||
|
|
@ -20,11 +21,12 @@ def extract_thermal_transmittance(result: dict, description: str) -> Tuple[
|
|||
"""
|
||||
|
||||
match = THERMAL_TRANSMITTANCE_REGEX.search(description)
|
||||
|
||||
if match:
|
||||
result['thermal_transmittance'] = float(match.group(1))
|
||||
result['thermal_transmittance_unit'] = match.group(2)
|
||||
# Remove the match from the description
|
||||
description = re.sub(THERMAL_TRANSMITTENCE_STR, "", description)
|
||||
description = re.sub(THERMAL_TRANSMITTANCE_STR, "", description)
|
||||
else:
|
||||
result['thermal_transmittance'] = None
|
||||
result['thermal_transmittance_unit'] = None
|
||||
|
|
|
|||
|
|
@ -690,5 +690,11 @@ wall_cases = [
|
|||
'thermal_transmittance_unit': None, 'is_cavity_wall': False, 'is_filled_cavity': False, 'is_solid_brick': True,
|
||||
'is_system_built': False, 'is_timber_frame': False, 'is_granite_or_whinstone': False, 'is_as_built': True,
|
||||
'is_cob': False, 'is_assumed': True, 'is_sandstone_or_limestone': False, 'insulation_thickness': 'none',
|
||||
'external_insulation': False, 'internal_insulation': False}
|
||||
'external_insulation': False, 'internal_insulation': False},
|
||||
{'original_description': 'Average thermal transmittance 1.60 W/m+é-¦K',
|
||||
'thermal_transmittance': 1.6, 'thermal_transmittance_unit': 'w/m+é-¦k', 'is_cavity_wall': False,
|
||||
'is_filled_cavity': False, 'is_solid_brick': False, 'is_system_built': False, 'is_timber_frame': False,
|
||||
'is_granite_or_whinstone': False, 'is_as_built': False, 'is_cob': False, 'is_assumed': False,
|
||||
'is_sandstone_or_limestone': False, 'insulation_thickness': None, 'external_insulation': False,
|
||||
'internal_insulation': False}
|
||||
]
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue