From 087384475f51a3279cbf96248e200da8784a837d Mon Sep 17 00:00:00 2001 From: p_monsalvete Date: Tue, 3 Oct 2023 09:40:32 -0400 Subject: [PATCH] changing from generation system to generation systemS in system importer north america --- ...america_custom_energy_system_parameters.py | 55 ++++++++++--------- hub/imports/energy_systems_factory.py | 3 +- 2 files changed, 31 insertions(+), 27 deletions(-) diff --git a/hub/imports/energy_systems/north_america_custom_energy_system_parameters.py b/hub/imports/energy_systems/north_america_custom_energy_system_parameters.py index 43d339a9..72e60fcf 100644 --- a/hub/imports/energy_systems/north_america_custom_energy_system_parameters.py +++ b/hub/imports/energy_systems/north_america_custom_energy_system_parameters.py @@ -86,33 +86,36 @@ class NorthAmericaCustomEnergySystemParameters: _hub_demand_types.append(Dictionaries().north_america_demand_type_to_hub_energy_demand_type[demand_type]) energy_system.name = system.name energy_system.demand_types = _hub_demand_types - _generation_system = GenericGenerationSystem() - archetype_generation_equipment = system.generation_systems - _type = system.name - _generation_system.type = Dictionaries().north_america_system_to_hub_energy_generation_system[_type] - _fuel_type = Dictionaries().north_america_custom_fuel_to_hub_fuel[archetype_generation_equipment.fuel_type] - _generation_system.fuel_type = _fuel_type - _generation_system.source_types = archetype_generation_equipment.source_medium - _generation_system.heat_efficiency = archetype_generation_equipment.heat_efficiency - _generation_system.cooling_efficiency = archetype_generation_equipment.cooling_efficiency - _generation_system.electricity_efficiency = archetype_generation_equipment.electricity_efficiency - _generation_system.source_temperature = archetype_generation_equipment.source_temperature - _generation_system.source_mass_flow = archetype_generation_equipment.source_mass_flow - _generation_system.storage = None - _generation_system.auxiliary_equipment = None - _generation_system._supply_medium = archetype_generation_equipment.supply_medium - _generation_system._maximum_heat_supply_temperature = archetype_generation_equipment.maximum_heat_supply_temperature - _generation_system._minimum_heat_supply_temperature = archetype_generation_equipment.minimum_heat_supply_temperature - _generation_system._maximum_cooling_supply_temperature = archetype_generation_equipment.maximum_cooling_supply_temperature - _generation_system._minimum_cooling_supply_temperature = archetype_generation_equipment.minimum_cooling_supply_temperature - _generation_system._heat_output_curve = archetype_generation_equipment.heat_output_curve - _generation_system._heat_fuel_consumption_curve = archetype_generation_equipment.heat_fuel_consumption_curve - _generation_system._heat_efficiency_curve = archetype_generation_equipment.heat_efficiency_curve - _generation_system._cooling_output_curve = archetype_generation_equipment.cooling_output_curve - _generation_system._cooling_fuel_consumption_curve = archetype_generation_equipment.cooling_fuel_consumption_curve - _generation_system._cooling_efficiency_curve = archetype_generation_equipment.cooling_efficiency_curve + archetype_generation_equipments = system.generation_systems + _generation_systems = [] + for archetype_generation_equipment in archetype_generation_equipments: + _generation_system = GenericGenerationSystem() + _type = archetype_generation_equipment.name + _generation_system.type = Dictionaries().north_america_system_to_hub_energy_generation_system[_type] + _fuel_type = Dictionaries().north_america_custom_fuel_to_hub_fuel[archetype_generation_equipment.fuel_type] + _generation_system.fuel_type = _fuel_type + _generation_system.source_types = archetype_generation_equipment.source_medium + _generation_system.heat_efficiency = archetype_generation_equipment.heat_efficiency + _generation_system.cooling_efficiency = archetype_generation_equipment.cooling_efficiency + _generation_system.electricity_efficiency = archetype_generation_equipment.electricity_efficiency + _generation_system.source_temperature = archetype_generation_equipment.source_temperature + _generation_system.source_mass_flow = archetype_generation_equipment.source_mass_flow + _generation_system.storage = None + _generation_system.auxiliary_equipment = None + _generation_system._supply_medium = archetype_generation_equipment.supply_medium + _generation_system._maximum_heat_supply_temperature = archetype_generation_equipment.maximum_heat_supply_temperature + _generation_system._minimum_heat_supply_temperature = archetype_generation_equipment.minimum_heat_supply_temperature + _generation_system._maximum_cooling_supply_temperature = archetype_generation_equipment.maximum_cooling_supply_temperature + _generation_system._minimum_cooling_supply_temperature = archetype_generation_equipment.minimum_cooling_supply_temperature + _generation_system._heat_output_curve = archetype_generation_equipment.heat_output_curve + _generation_system._heat_fuel_consumption_curve = archetype_generation_equipment.heat_fuel_consumption_curve + _generation_system._heat_efficiency_curve = archetype_generation_equipment.heat_efficiency_curve + _generation_system._cooling_output_curve = archetype_generation_equipment.cooling_output_curve + _generation_system._cooling_fuel_consumption_curve = archetype_generation_equipment.cooling_fuel_consumption_curve + _generation_system._cooling_efficiency_curve = archetype_generation_equipment.cooling_efficiency_curve + _generation_systems.append(_generation_system) - energy_system.generation_system = _generation_system + energy_system.generation_systems = _generation_systems _thermal_storage_system = ThermalStorageSystem() archetype_storage_equipment = system.energy_storage_systems diff --git a/hub/imports/energy_systems_factory.py b/hub/imports/energy_systems_factory.py index c059961c..3c4bccef 100644 --- a/hub/imports/energy_systems_factory.py +++ b/hub/imports/energy_systems_factory.py @@ -9,6 +9,7 @@ from pathlib import Path from hub.helpers.utils import validate_import_export_type from hub.imports.energy_systems.montreal_custom_energy_system_parameters import MontrealCustomEnergySystemParameters +from hub.imports.energy_systems.north_america_custom_energy_system_parameters import NorthAmericaCustomEnergySystemParameters class EnergySystemsFactory: @@ -37,7 +38,7 @@ class EnergySystemsFactory: """ Enrich the city by using north america custom energy systems catalog information """ - MontrealCustomEnergySystemParameters(self._city).enrich_buildings() + NorthAmericaCustomEnergySystemParameters(self._city).enrich_buildings() self._city.level_of_detail.energy_systems = 2 for building in self._city.buildings: building.level_of_detail.energy_systems = 2