Tried to modify the test_systems_factory.py but received an error saying GenerationSystem object is not iterable
This commit is contained in:
parent
f0ad1462d0
commit
cbda6ce13d
|
@ -744,15 +744,18 @@ class Building(CityObject):
|
||||||
if self.energy_systems is None:
|
if self.energy_systems is None:
|
||||||
return None
|
return None
|
||||||
for energy_system in self.energy_systems:
|
for energy_system in self.energy_systems:
|
||||||
|
generation_systems = energy_system.generation_system
|
||||||
for demand_type in energy_system.demand_types:
|
for demand_type in energy_system.demand_types:
|
||||||
if demand_type.lower() == consumption_type.lower():
|
if demand_type.lower() == consumption_type.lower():
|
||||||
if consumption_type in (cte.HEATING, cte.DOMESTIC_HOT_WATER):
|
if consumption_type in (cte.HEATING, cte.DOMESTIC_HOT_WATER):
|
||||||
coefficient_of_performance = energy_system.generation_system.generic_generation_system.heat_efficiency
|
for generation_system in generation_systems:
|
||||||
|
coefficient_of_performance = generation_system.generic_generation_system.heat_efficiency
|
||||||
elif consumption_type == cte.COOLING:
|
elif consumption_type == cte.COOLING:
|
||||||
coefficient_of_performance = energy_system.generation_system.generic_generation_system.cooling_efficiency
|
for generation_system in generation_systems:
|
||||||
|
coefficient_of_performance = generation_system.generic_generation_system.cooling_efficiency
|
||||||
elif consumption_type == cte.ELECTRICITY:
|
elif consumption_type == cte.ELECTRICITY:
|
||||||
coefficient_of_performance = \
|
for generation_system in generation_systems:
|
||||||
energy_system.generation_system.generic_generation_system.electricity_efficiency
|
coefficient_of_performance = generation_system.generic_generation_system.electricity_efficiency
|
||||||
if coefficient_of_performance == 0:
|
if coefficient_of_performance == 0:
|
||||||
values = [0]*len(demand)
|
values = [0]*len(demand)
|
||||||
final_energy_consumed = values
|
final_energy_consumed = values
|
||||||
|
|
|
@ -161,16 +161,20 @@ class TestSystemsFactory(TestCase):
|
||||||
|
|
||||||
_building_distribution_system = DistributionSystem()
|
_building_distribution_system = DistributionSystem()
|
||||||
_building_distribution_system.generic_distribution_system = (
|
_building_distribution_system.generic_distribution_system = (
|
||||||
copy.deepcopy(_generic_building_energy_system.distribution_systems)
|
copy.deepcopy(_generic_building_energy_system.distribution_system)
|
||||||
)
|
)
|
||||||
_building_emission_system = EmissionSystem()
|
_building_emission_system = EmissionSystem()
|
||||||
_building_emission_system.generic_emission_system = (
|
_building_emission_system.generic_emission_system = (
|
||||||
copy.deepcopy(_generic_building_energy_system.emission_systems)
|
copy.deepcopy(_generic_building_energy_system.emission_system)
|
||||||
)
|
)
|
||||||
_building_generation_system = GenerationSystem()
|
_building_generation_system = GenerationSystem()
|
||||||
_building_generation_system.generic_generation_system = (
|
_building_generation_system.generic_generation_system = (
|
||||||
copy.deepcopy(_generic_building_energy_system.generation_system)
|
copy.deepcopy(_generic_building_energy_system.generation_system)
|
||||||
)
|
)
|
||||||
|
_building_storage_system = ThermalStorageSystem()
|
||||||
|
_building_storage_system.generic_storage_system = \
|
||||||
|
copy.deepcopy(_generic_building_energy_system.energy_storage_system)
|
||||||
|
|
||||||
if cte.HEATING in _building_energy_equipment.demand_types:
|
if cte.HEATING in _building_energy_equipment.demand_types:
|
||||||
_building_generation_system.heat_power = building.heating_peak_load[cte.YEAR][0]
|
_building_generation_system.heat_power = building.heating_peak_load[cte.YEAR][0]
|
||||||
if cte.COOLING in _building_energy_equipment.demand_types:
|
if cte.COOLING in _building_energy_equipment.demand_types:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user