Correct bd test, add dictionary for custom fuel to hub fuel

This commit is contained in:
Guille Gutierrez 2023-08-02 12:43:51 -04:00
parent 4d0f247a83
commit c38b025c2e
5 changed files with 39 additions and 17 deletions

View File

@ -0,0 +1,28 @@
"""
Dictionaries module for montreal custom fuel to hub fuel
SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2022 Concordia CERC group
Project Coder Guille Gutierrez Guillermo.GutierrezMorote@concordia.ca
"""
import hub.helpers.constants as cte
class MontrealCustomFuelToHubFuel:
"""
Montreal custom fuel to hub fuel class
"""
def __init__(self):
self._dictionary = {
'gas': cte.GAS,
'electricity': cte.ELECTRICITY,
'renewable': cte.RENEWABLE
}
@property
def dictionary(self) -> dict:
"""
Get the dictionary
:return: {}
"""
return self._dictionary

View File

@ -6,6 +6,7 @@ Project Coder Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca
""" """
from hub.helpers.data.hft_function_to_hub_function import HftFunctionToHubFunction from hub.helpers.data.hft_function_to_hub_function import HftFunctionToHubFunction
from hub.helpers.data.montreal_custom_fuel_to_hub_fuel import MontrealCustomFuelToHubFuel
from hub.helpers.data.montreal_function_to_hub_function import MontrealFunctionToHubFunction from hub.helpers.data.montreal_function_to_hub_function import MontrealFunctionToHubFunction
from hub.helpers.data.eilat_function_to_hub_function import EilatFunctionToHubFunction from hub.helpers.data.eilat_function_to_hub_function import EilatFunctionToHubFunction
from hub.helpers.data.alkis_function_to_hub_function import AlkisFunctionToHubFunction from hub.helpers.data.alkis_function_to_hub_function import AlkisFunctionToHubFunction
@ -141,3 +142,10 @@ class Dictionaries:
Get Eilat's function to hub function, transformation dictionary Get Eilat's function to hub function, transformation dictionary
""" """
return EilatFunctionToHubFunction().dictionary return EilatFunctionToHubFunction().dictionary
@property
def montreal_custom_fuel_to_hub_fuel(self) -> dict:
"""
Get hub fuel from montreal_custom catalog fuel
"""
return MontrealCustomFuelToHubFuel().dictionary

View File

@ -13,10 +13,7 @@ class ConstructionHelper:
Construction helper Construction helper
""" """
# NREL # NREL
_nrel_standards = {
'ASHRAE Std189': 1,
'ASHRAE 90.1_2004': 2
}
_reference_city_to_nrel_climate_zone = { _reference_city_to_nrel_climate_zone = {
'Miami': 'ASHRAE_2004:1A', 'Miami': 'ASHRAE_2004:1A',
'Houston': 'ASHRAE_2004:2A', 'Houston': 'ASHRAE_2004:2A',
@ -35,17 +32,6 @@ class ConstructionHelper:
'Duluth': 'ASHRAE_2004:7A', 'Duluth': 'ASHRAE_2004:7A',
'Fairbanks': 'ASHRAE_2004:8A' 'Fairbanks': 'ASHRAE_2004:8A'
} }
nrel_window_types = [cte.WINDOW, cte.DOOR, cte.SKYLIGHT]
nrel_construction_types = {
cte.WALL: 'exterior wall',
cte.INTERIOR_WALL: 'interior wall',
cte.GROUND_WALL: 'ground wall',
cte.GROUND: 'exterior slab',
cte.ATTIC_FLOOR: 'attic floor',
cte.INTERIOR_SLAB: 'interior slab',
cte.ROOF: 'roof'
}
_reference_city_to_nrcan_climate_zone = { _reference_city_to_nrcan_climate_zone = {
'Montreal': '6', 'Montreal': '6',

View File

@ -91,7 +91,7 @@ class MontrealCustomEnergySystemParameters:
_type = system.name _type = system.name
_generation_system.type = Dictionaries().montreal_system_to_hub_energy_generation_system[ _generation_system.type = Dictionaries().montreal_system_to_hub_energy_generation_system[
_type] _type]
_fuel_type = EnergySystemsHelper().montreal_custom_fuel_to_hub_fuel(archetype_generation_equipment.fuel_type) _fuel_type = Dictionaries().montreal_custom_fuel_to_hub_fuel[archetype_generation_equipment.fuel_type]
_generation_system.fuel_type = _fuel_type _generation_system.fuel_type = _fuel_type
_generation_system.source_types = archetype_generation_equipment.source_types _generation_system.source_types = archetype_generation_equipment.source_types
_generation_system.heat_efficiency = archetype_generation_equipment.heat_efficiency _generation_system.heat_efficiency = archetype_generation_equipment.heat_efficiency

View File

@ -283,7 +283,7 @@ TestDBFactory
control.database.add_simulation_results( control.database.add_simulation_results(
cte.INSEL_MEB, cte.INSEL_MEB,
results, city_object_id=db_building_id) results, city_object_id=db_building_id)
self.assertEqual(1, len(city_objects_id), 'wrong number of results') self.assertEqual(17, len(city_objects_id), 'wrong number of results')
self.assertIsNotNone(city_objects_id[0], 'city_object_id is None') self.assertIsNotNone(city_objects_id[0], 'city_object_id is None')
""" """
for _id in city_objects_id: for _id in city_objects_id: