diff --git a/data/occupancyschedules_2019_point4.xlsx b/data/occupancyschedules_2019_point4.xlsx new file mode 100644 index 00000000..164f73cb Binary files /dev/null and b/data/occupancyschedules_2019_point4.xlsx differ diff --git a/imports/customized_imports/stochastic_schedules_importer.py b/imports/customized_imports/stochastic_schedules_importer.py index a71378e4..2832bf61 100644 --- a/imports/customized_imports/stochastic_schedules_importer.py +++ b/imports/customized_imports/stochastic_schedules_importer.py @@ -15,13 +15,12 @@ class StochasticSchedulesImporter: """ StochasticSchedulesImporter class """ - def __init__(self, city, base_path, buildings=None): - file = 'Occupancy_schedules_EVBuilding.xlsx' - path = str(base_path / file) + def __init__(self, city, path, buildings=None): if buildings is None: self._buildings = city.buildings else: self._buildings = buildings + # todo: change to csv reading self._xls = pd.ExcelFile(path) def enrich_buildings(self): diff --git a/imports/customized_imports_factory.py b/imports/customized_imports_factory.py index a070c095..20f5d0e6 100644 --- a/imports/customized_imports_factory.py +++ b/imports/customized_imports_factory.py @@ -5,16 +5,13 @@ SPDX - License - Identifier: LGPL - 3.0 - or -later Copyright © 2022 Concordia CERC group Project Coder Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca """ -from pathlib import Path class CustomizedImportsFactory: """ CustomizedImportsFactory class """ - def __init__(self, importer_class, city, base_path=None): - if base_path is None: - base_path = Path('C:/Users/Pilar/Documents/Pycharm_repository/Workshops/ep_workflow/inputs/') + def __init__(self, importer_class, city, base_path): self._importer_class = importer_class self._city = city self._base_path = base_path diff --git a/scripts/ep_workflow.py b/scripts/ep_workflow.py index fde6194b..07705646 100644 --- a/scripts/ep_workflow.py +++ b/scripts/ep_workflow.py @@ -1,13 +1,14 @@ import sys from pathlib import Path import csv -sys.path.append('/home/guille/Projects/Concordia/libs') +sys.path.append('../libs') from imports.geometry_factory import GeometryFactory from imports.construction_factory import ConstructionFactory from imports.usage_factory import UsageFactory -from imports.schedules_factory import SchedulesFactory from exports.exports_factory import ExportsFactory +from imports.customized_imports_factory import CustomizedImportsFactory +from imports.customized_imports.stochastic_schedules_importer import StochasticSchedulesImporter as ssi for argument_tuple in sys.argv[1:]: argument = argument_tuple.split(' ') @@ -19,21 +20,15 @@ for argument_tuple in sys.argv[1:]: print('[simulation start]') city = GeometryFactory('citygml', gml).city print(f'city created from {gml}') +for building in city.buildings: + building.year_of_construction = 2006 ConstructionFactory('nrel', city).enrich() print('enrich constructions... done') UsageFactory('comnet', city).enrich() print('enrich usage... done') -SchedulesFactory('comnet', city).enrich() -print('enrich schedules... done') - -for building in city.buildings: - for usage in building.usage_zones: - if usage.cooling_setpoint is None: - print(f'set cooling for building {building.name} to 23°') - usage.cooling_setpoint = 23.0 - if usage.heating_setpoint is None: - print(f'set heating for building {building.name} to 23°') - usage.heating_setpoint = 23.0 +in_path = (Path(__file__).parent.parent / 'data' / 'occupancyschedules_2019_point4.xlsx') +CustomizedImportsFactory(ssi, city, in_path).enrich() +print('enrich stochastic schedules for occupancy... done') area = 0 volume = 0 @@ -46,7 +41,8 @@ print('exporting:') out_path = (Path(__file__).parent.parent / 'out_files') ExportsFactory('obj', city, out_path).export() print(' geometry exported...') -_idf = ExportsFactory('idf', city, out_path).export() +# todo: _idf exporter does not catch errors in exporting +_idf = ExportsFactory('idf', city, out_path).export_debug() print(' idf exported...') _idf.run() diff --git a/scripts/workshop_ep_workflow.py b/scripts/workshop_ep_workflow.py deleted file mode 100644 index a35b7010..00000000 --- a/scripts/workshop_ep_workflow.py +++ /dev/null @@ -1,22 +0,0 @@ -import sys -sys.path.append('C:/Users/Pilar/PycharmProjects/libs') - -from imports.geometry_factory import GeometryFactory -from imports.construction_factory import ConstructionFactory -from imports.usage_factory import UsageFactory -from exports.exports_factory import ExportsFactory -from imports.customized_imports_factory import CustomizedImportsFactory -from imports.customized_imports.stochastic_schedules_importer import StochasticSchedulesImporter as ssi - - -city = GeometryFactory('citygml', 'C:/Users/Pilar/Documents/Pycharm_repository/Workshops/ep_workflow/' - 'inputs/one_building_in_kelowna.gml').city -for building in city.buildings: - building.year_of_construction = 2006 -ConstructionFactory('nrel', city).enrich() -UsageFactory('comnet', city).enrich() -CustomizedImportsFactory(ssi, city).enrich() - -_idf = ExportsFactory('idf', city, - 'C:/Users/Pilar/Documents/Pycharm_repository/Workshops/ep_workflow/outputs/').export_debug() -_idf.run()