diff --git a/hub/imports/energy_systems/helpers/__init__.py b/hub/imports/energy_systems/helpers/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/hub/imports/energy_systems/helpers/energy_systems_helper.py b/hub/imports/energy_systems/helpers/energy_systems_helper.py new file mode 100644 index 00000000..15bb2fa9 --- /dev/null +++ b/hub/imports/energy_systems/helpers/energy_systems_helper.py @@ -0,0 +1,29 @@ +""" +Energy systems helper +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 hub.helpers import constants as cte + + +class EnergySystemsHelper: + """ + EnergySystems helper + """ + _montreal_custom_fuel_to_hub_fuel = { + cte.GAS: 'gas', + cte.ELECTRICITY: 'electricity', + cte.RENEWABLE: 'renewable' + } + + @staticmethod + def montreal_custom_fuel_to_hub_fuel(fuel): + """ + Get hub fuel from montreal_custom catalog fuel + :param fuel: str + :return: str + """ + return EnergySystemsHelper._montreal_custom_fuel_to_hub_fuel[fuel] + 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 f7349d3d..479e5630 100644 --- a/hub/imports/energy_systems/montreal_custom_energy_system_parameters.py +++ b/hub/imports/energy_systems/montreal_custom_energy_system_parameters.py @@ -19,6 +19,7 @@ from hub.city_model_structure.energy_systems.generation_system import Generation from hub.city_model_structure.energy_systems.distribution_system import DistributionSystem from hub.city_model_structure.energy_systems.emission_system import EmissionSystem from hub.helpers.dictionaries import Dictionaries +from hub.imports.energy_systems.helpers.energy_systems_helper import EnergySystemsHelper class MontrealCustomEnergySystemParameters: @@ -87,7 +88,8 @@ class MontrealCustomEnergySystemParameters: _type = str(system.name).split('_', maxsplit=1)[0] _generation_system.type = Dictionaries().montreal_system_to_hub_energy_generation_system[ _type] - _generation_system.fuel_type = archetype_generation_equipment.fuel_type + _fuel_type = EnergySystemsHelper().montreal_custom_fuel_to_hub_fuel(archetype_generation_equipment.fuel_type) + _generation_system.fuel_type = _fuel_type _generation_system.source_types = archetype_generation_equipment.source_types _generation_system.heat_efficiency = archetype_generation_equipment.heat_efficiency _generation_system.cooling_efficiency = archetype_generation_equipment.cooling_efficiency