Validation in progress

This commit is contained in:
Guille Gutierrez 2024-10-17 06:13:23 +02:00
parent 841a6136bb
commit 6020964899
3 changed files with 10 additions and 9 deletions

View File

@ -1,5 +1,5 @@
from pathlib import Path
import hub.helpers.constants as cte
import hub.exports.building_energy.idf_helper as idf_cte
from hub.exports.building_energy.idf_helper.idf_base import IdfBase
@ -14,8 +14,8 @@ class IdfFileSchedule(IdfBase):
file_name = str(
(Path(self._output_path) / f'{schedule_type} schedules {usage.replace("/", "_")}.csv').resolve())
with open(file_name, 'w', encoding='utf8') as file:
for value in schedule.values:
file.write(f'{str(value)},\n')
for value in schedule.values[0]:
file.write(f'{value},\n')
file = self._files['file_schedules']
self._write_to_idf_format(file, idf_cte.FILE_SCHEDULE)
self._write_to_idf_format(file, schedule_name, 'Name')

View File

@ -41,7 +41,7 @@ class IdfWindow(IdfBase):
if not is_exposed:
continue
name = f'Building_{building.name}_window_{index}'
construction_name = f'{boundary.construction_name}_window'
construction_name = f'{boundary.construction_name}_window_construction'
self._write_to_idf_format(file, idf_cte.WINDOW_SURFACE)
self._write_to_idf_format(file, name, 'Name')
self._write_to_idf_format(file, 'Window', 'Surface Type')

View File

@ -128,30 +128,31 @@ class TestExports(TestCase):
"""
export to IDF
"""
"file = '1588_v1.geojson'"
file = 'test.geojson'
file = '1588_v1.geojson'
# file = 'test.geojson'
file_path = (self._example_path / file).resolve()
"""
city = GeometryFactory('geojson',
path=file_path,
height_field='citygml_me',
year_of_construction_field='ANNEE_CONS',
function_field='CODE_UTILI',
function_to_hub=Dictionaries().montreal_function_to_hub_function).city
"""
"""=-043
"name": "01043081",
"address": "avenue de l' H\u00f4tel-de-Ville (MTL) 3751",
"function": "6911",
"height": 21,
"year_of_construction": 1964,
"""
city = GeometryFactory('geojson',
path=file_path,
height_field='height',
year_of_construction_field='year_of_construction',
function_field='function',
function_to_hub=Dictionaries().montreal_function_to_hub_function).city
"""
# """
self.assertIsNotNone(city, 'city is none')
#EnergyBuildingsExportsFactory('idf', city, self._output_path).export()
ConstructionFactory('nrcan', city).enrich()