diff --git a/hub/city_model_structure/building.py b/hub/city_model_structure/building.py index 5bd1f94c..b2d1e160 100644 --- a/hub/city_model_structure/building.py +++ b/hub/city_model_structure/building.py @@ -629,16 +629,18 @@ class Building(CityObject): return: dict """ if len(self._distribution_systems_electrical_consumption) == 0: - _peak_load = self.heating_peak_load[cte.YEAR]['heating peak loads'][0] + _peak_load = self.heating_peak_load[cte.YEAR][cte.HEATING_PEAK_LOAD][0] _peak_load_type = cte.HEATING - if _peak_load < self.cooling_peak_load[cte.YEAR]['cooling peak loads'][0]: - _peak_load = self.cooling_peak_load[cte.YEAR]['cooling peak loads'][0] + if _peak_load < self.cooling_peak_load[cte.YEAR][cte.COOLING_PEAK_LOAD][0]: + _peak_load = self.cooling_peak_load[cte.YEAR][cte.COOLING_PEAK_LOAD][0] _peak_load_type = cte.COOLING _consumption_fix_flow = 0 for energy_system in self.energy_systems: emission_system = energy_system.emission_system.generic_emission_system - parasitic_energy_consumption = emission_system.parasitic_energy_consumption + parasitic_energy_consumption = 0 + if emission_system is not None: + parasitic_energy_consumption = emission_system.parasitic_energy_consumption distribution_system = energy_system.distribution_system.generic_distribution_system consumption_variable_flow = distribution_system.distribution_consumption_variable_flow for demand_type in energy_system.demand_types: