From 6941484d5940c5bdbd23f73faecb018ba1c10998 Mon Sep 17 00:00:00 2001 From: Guille Date: Mon, 17 Jul 2023 15:35:21 -0400 Subject: [PATCH] Bug fixing in packet --- costs/capital_costs.py | 4 ++-- costs/cost_base.py | 6 +++--- costs/total_maintenance_costs.py | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/costs/capital_costs.py b/costs/capital_costs.py index e26c997..7c6049c 100644 --- a/costs/capital_costs.py +++ b/costs/capital_costs.py @@ -88,8 +88,8 @@ class CapitalCosts(CostBase): surface_opaque += thermal_boundary.opaque_area * (1 - thermal_boundary.window_ratio) surface_transparent += thermal_boundary.opaque_area * thermal_boundary.window_ratio - peak_heating = self._building.heating_peak_load[cte.YEAR].values[0] / 1000 - peak_cooling = self._building.cooling_peak_load[cte.YEAR].values[0] / 1000 + peak_heating = self._building.heating_peak_load[cte.YEAR][0] / 1000 + peak_cooling = self._building.cooling_peak_load[cte.YEAR][0] / 1000 surface_pv = 0 for roof in self._building.roofs: diff --git a/costs/cost_base.py b/costs/cost_base.py index 7c52722..f78d060 100644 --- a/costs/cost_base.py +++ b/costs/cost_base.py @@ -20,16 +20,16 @@ class CostBase: for thermal_zone in internal_zone.thermal_zones: self._total_floor_area += thermal_zone.total_floor_area self._archetype = None - + self._capital_costs_chapter = None for archetype in self._configuration.costs_catalog.entries().archetypes: - if str(building.function) == configuration.dictionary[str(archetype.function)]: + if configuration.dictionary[str(building.function)] == str(archetype.function): self._archetype = archetype self._capital_costs_chapter = self._archetype.capital_cost break if not self._archetype: raise KeyError(f'archetype not found for function {building.function}') - self._capital_costs_chapter = None + self._rng = range(configuration.number_of_years) def calculate(self): diff --git a/costs/total_maintenance_costs.py b/costs/total_maintenance_costs.py index c28b3df..8e7f01a 100644 --- a/costs/total_maintenance_costs.py +++ b/costs/total_maintenance_costs.py @@ -39,8 +39,8 @@ class TotalMaintenanceCosts(CostBase): roof_area += roof.solid_polygon.area surface_pv = roof_area * 0.5 - peak_heating = building.heating_peak_load[cte.YEAR][cte.HEATING_PEAK_LOAD][0] - peak_cooling = building.cooling_peak_load[cte.YEAR][cte.COOLING_PEAK_LOAD][0] + peak_heating = building.heating_peak_load[cte.YEAR][0] + peak_cooling = building.cooling_peak_load[cte.YEAR][0] maintenance_heating_0 = peak_heating * archetype.operational_cost.maintenance_heating maintenance_cooling_0 = peak_cooling * archetype.operational_cost.maintenance_cooling