From 585530d3db80a50c06bff672a6c01cce7aa4d736 Mon Sep 17 00:00:00 2001 From: Pilar Date: Tue, 10 Jan 2023 09:55:37 -0500 Subject: [PATCH] updating the code to changes in hub (not finished -> not working) --- .idea/DynamicBuildingSimulation.iml | 4 +- .idea/misc.xml | 2 +- main.py | 18 +- tests/tmp/Montreal.cli | 2 +- tests/tmp/Montréal_sra.xml | 594 ---------------------------- 5 files changed, 13 insertions(+), 607 deletions(-) delete mode 100644 tests/tmp/Montréal_sra.xml diff --git a/.idea/DynamicBuildingSimulation.iml b/.idea/DynamicBuildingSimulation.iml index c64d827..ec37de3 100644 --- a/.idea/DynamicBuildingSimulation.iml +++ b/.idea/DynamicBuildingSimulation.iml @@ -2,9 +2,9 @@ - + - + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml index 21dfa1d..49e36f0 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,4 +1,4 @@ - + \ No newline at end of file diff --git a/main.py b/main.py index ca258d3..ca6ab9f 100644 --- a/main.py +++ b/main.py @@ -1,15 +1,15 @@ import sys from insel.insel import Insel from pathlib import Path -from helpers.enrich_city import EnrichCity from simplified_radiosity_algorithm import SimplifiedRadiosityAlgorithm from imports.weather_factory import WeatherFactory from insel.templates.thermal_demand_dynamic_simulation import ThermalDemandDynamicSimulation as Templates from helpers.simulation_parameters import SimulationParameters as Sp from imports.geometry_factory import GeometryFactory -from imports.geometry.helpers.geometry_helper import GeometryHelper from city_model_structure.city import City - +from imports.construction_factory import ConstructionFactory +from imports.usage_factory import UsageFactory +from helpers.dictionaries import Dictionaries name_gml = 'one_building_in_kelowna.gml' function_format = 'hft' @@ -23,13 +23,13 @@ example_path = Path(__file__).parent full_path_gml = (example_path / 'tests' / 'tests_data' / name_gml).resolve() outputs_path = (example_path / 'tests' / 'tests_outputs').resolve() tmp_path = (example_path / 'tests' / 'tmp').resolve() -weather_path = (Path(__file__).parent.parent / 'libs' / 'data' / 'weather').resolve() +weather_path = (Path(__file__).parent.parent / 'hub' / 'data' / 'weather').resolve() keep_sra_file = True keep_insel_file = True keep_weather_file = True keep_ig_file = True -pickle_geometry = True +pickle_geometry = False pickle_weather = False pickle_construction = False pickle_usage = False @@ -81,11 +81,11 @@ if not pickle_construction or not pickle_usage or not pickle_schedules: building.year_of_construction = 2010 if function_format == 'hft': - building.function = GeometryHelper.hft_to_function[building.function] + building.function = Dictionaries().hft_function_to_hub_function[building.function] elif function_format == 'pluto': - building.function = GeometryHelper.pluto_to_function[building.function] - city = EnrichCity(city).enriched_city(construction_format, usage_format, schedules_format, - pickle_construction, pickle_usage, pickle_schedules) + building.function = Dictionaries().pluto_function_to_hub_function[building.function] + ConstructionFactory(construction_format, city).enrich() + UsageFactory(usage_format, city).enrich() city.save(pickle_file) else: diff --git a/tests/tmp/Montreal.cli b/tests/tmp/Montreal.cli index c3770be..9b5b4f1 100644 --- a/tests/tmp/Montreal.cli +++ b/tests/tmp/Montreal.cli @@ -1,4 +1,4 @@ -Montréal +Kelowna 45.47,-73.75,0.0,-5.0 dm m h G_Dh G_Bn diff --git a/tests/tmp/Montréal_sra.xml b/tests/tmp/Montréal_sra.xml deleted file mode 100644 index 5ed93a4..0000000 --- a/tests/tmp/Montréal_sra.xml +++ /dev/null @@ -1,594 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file