diff --git a/hub/catalog_factories/data_models/energy_systems/archetype.py b/hub/catalog_factories/data_models/energy_systems/archetype.py index cdfcea1f..86bfb68d 100644 --- a/hub/catalog_factories/data_models/energy_systems/archetype.py +++ b/hub/catalog_factories/data_models/energy_systems/archetype.py @@ -34,7 +34,7 @@ class Archetype: Get name :return: string """ - return f'{self._name}_lod{self._lod}' + return self._name @property def systems(self) -> List[System]: diff --git a/hub/catalog_factories/data_models/energy_systems/system.py b/hub/catalog_factories/data_models/energy_systems/system.py index f5804c83..6059bec7 100644 --- a/hub/catalog_factories/data_models/energy_systems/system.py +++ b/hub/catalog_factories/data_models/energy_systems/system.py @@ -55,7 +55,7 @@ class System: Get name :return: string """ - return f'{self._name}_lod{self._lod}' + return self._name @property def demand_types(self): diff --git a/hub/imports/energy_systems/montreal_custom_energy_system_parameters.py b/hub/imports/energy_systems/montreal_custom_energy_system_parameters.py index 479e5630..443be2fa 100644 --- a/hub/imports/energy_systems/montreal_custom_energy_system_parameters.py +++ b/hub/imports/energy_systems/montreal_custom_energy_system_parameters.py @@ -46,7 +46,7 @@ class MontrealCustomEnergySystemParameters: else: _generic_energy_systems = city.generic_energy_systems for building in city.buildings: - archetype_name = f'{building.energy_systems_archetype_name}_lod1.0' + archetype_name = building.energy_systems_archetype_name try: archetype = self._search_archetypes(montreal_custom_catalog, archetype_name) except KeyError: @@ -54,9 +54,12 @@ class MontrealCustomEnergySystemParameters: archetype_name) continue - _energy_systems_connection_table, _generic_energy_systems \ - = self._create_generic_systems(archetype, building, - _energy_systems_connection_table, _generic_energy_systems) + _energy_systems_connection_table, _generic_energy_systems = self._create_generic_systems( + archetype, + building, + _energy_systems_connection_table, + _generic_energy_systems + ) city.energy_systems_connection_table = _energy_systems_connection_table city.generic_energy_systems = _generic_energy_systems @@ -85,7 +88,7 @@ class MontrealCustomEnergySystemParameters: energy_system.demand_types = _hub_demand_types _generation_system = GenericGenerationSystem() archetype_generation_equipment = system.generation_system - _type = str(system.name).split('_', maxsplit=1)[0] + _type = system.name _generation_system.type = Dictionaries().montreal_system_to_hub_energy_generation_system[ _type] _fuel_type = EnergySystemsHelper().montreal_custom_fuel_to_hub_fuel(archetype_generation_equipment.fuel_type) diff --git a/hub/persistence/models/city_object.py b/hub/persistence/models/city_object.py index b7f2ace9..1b0b609a 100644 --- a/hub/persistence/models/city_object.py +++ b/hub/persistence/models/city_object.py @@ -33,6 +33,7 @@ class CityObject(Models): wall_area = Column(Float, nullable=False) windows_area = Column(Float, nullable=False) roof_area = Column(Float, nullable=False) + total_pv_area = Column(Float, nullable=False) system_name = Column(String, nullable=False) created = Column(DateTime, default=datetime.datetime.utcnow) updated = Column(DateTime, default=datetime.datetime.utcnow) @@ -48,6 +49,7 @@ class CityObject(Models): self.volume = building.volume self.area = building.floor_area self.roof_area = sum(roof.solid_polygon.area for roof in building.roofs) + self.total_pv_area = sum(roof.solid_polygon.area * roof.solar_collectors_area_reduction_factor for roof in building.roofs) storeys = building.storeys_above_ground if storeys is None: storeys = building.max_height / building.average_storey_height diff --git a/tests/tests_data/pickle_path.bz2 b/tests/tests_data/pickle_path.bz2 index 28450f58..76ab2ba6 100644 Binary files a/tests/tests_data/pickle_path.bz2 and b/tests/tests_data/pickle_path.bz2 differ