Merge remote-tracking branch 'origin/main' into retrofit_db_changes
This commit is contained in:
commit
ce995c375d
0
hub/imports/energy_systems/helpers/__init__.py
Normal file
0
hub/imports/energy_systems/helpers/__init__.py
Normal file
29
hub/imports/energy_systems/helpers/energy_systems_helper.py
Normal file
29
hub/imports/energy_systems/helpers/energy_systems_helper.py
Normal file
|
@ -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 = {
|
||||
'gas': cte.GAS,
|
||||
'electricity': cte.ELECTRICITY,
|
||||
'renewable': cte.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]
|
||||
|
|
@ -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
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
"""
|
||||
Hub version number
|
||||
"""
|
||||
__version__ = '0.1.7.27'
|
||||
__version__ = '0.1.7.28'
|
||||
|
|
Loading…
Reference in New Issue
Block a user