Compare commits

..

3 Commits

Author SHA1 Message Date
a331dce966 fixed error in logic in _create_generic_systems 2023-10-06 04:14:52 -04:00
3f91da9f45 Merge remote-tracking branch 'origin/energy_system_central_data_model' into energy_system_central_data_model
# Conflicts:
#	hub/imports/energy_systems/montreal_custom_energy_system_parameters.py
2023-10-06 04:13:32 -04:00
f13d7fd860 fixed error in logic in _associate_energy_systems 2023-10-06 04:11:56 -04:00
2 changed files with 40 additions and 41 deletions

View File

@ -75,9 +75,10 @@ class MontrealCustomEnergySystemParameters:
@staticmethod @staticmethod
def _create_generic_systems(archetype, building, def _create_generic_systems(archetype, building,
_energy_systems_connection_table, _generic_energy_systems): _energy_systems_connection_table, _generic_energy_systems):
building_systems = []
data = [archetype.name, building.name] data = [archetype.name, building.name]
_energy_systems_connection_table.loc[len(_energy_systems_connection_table)] = data _energy_systems_connection_table.loc[len(_energy_systems_connection_table)] = data
if archetype.name not in _generic_energy_systems:
building_systems = []
for system in archetype.systems: for system in archetype.systems:
energy_system = GenericEnergySystem() energy_system = GenericEnergySystem()
_hub_demand_types = [] _hub_demand_types = []
@ -116,7 +117,7 @@ class MontrealCustomEnergySystemParameters:
energy_system.distribution_systems = _distribution_system energy_system.distribution_systems = _distribution_system
building_systems.append(energy_system) building_systems.append(energy_system)
if archetype.name not in _generic_energy_systems:
_generic_energy_systems[archetype.name] = building_systems _generic_energy_systems[archetype.name] = building_systems
return _energy_systems_connection_table, _generic_energy_systems return _energy_systems_connection_table, _generic_energy_systems

View File

@ -41,5 +41,3 @@ class TestSystemsCatalog(TestCase):
def test_north_america_systems_catalog(self): def test_north_america_systems_catalog(self):
catalog = EnergySystemsCatalogFactory('north_america').catalog catalog = EnergySystemsCatalogFactory('north_america').catalog
print(catalog.entries()) print(catalog.entries())