Remove all co2 emission code/files

This commit is contained in:
Koa Wells 2023-07-28 13:33:47 -04:00
parent 41b9fe4049
commit ea666afb02
2 changed files with 1 additions and 85 deletions

View File

@ -1,80 +0,0 @@
"""
CO2 emission module
SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2023 Project Coder Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca
"""
from hub.city_model_structure.building import Building
import hub.helpers.constants as cte
class Co2Emission:
"""
Cost class
"""
def __init__(self, building: Building, emissions_factor=None):
if emissions_factor is None:
emissions_factor = {cte.GAS: 1,
cte.ELECTRICITY: 1,
cte.WOOD: 1,
cte.DIESEL: 1,
cte.RENEWABLE: 0}
self._emissions_factor = emissions_factor
self._building = building
@property
def building(self) -> Building:
"""
Get current building.
"""
return self._building
@property
def operational_co2(self) -> dict:
"""
Get operational_co2
:return: dict
"""
results = {}
for energy_system in self._building.energy_systems:
fuel_type = energy_system.generation_system.generic_generation_system.fuel_type
for demand_type in energy_system.demand_types:
results_by_time_period = {}
if str(demand_type).lower() == str(cte.HEATING).lower():
for time_period in self._building.heating_consumption:
values = []
for value in self._building.heating_consumption[time_period]:
values.append(value * self._emissions_factor[fuel_type])
results_by_time_period[time_period] = values
if demand_type == cte.COOLING:
for time_period in self._building.cooling_consumption:
values = []
for value in self._building.cooling_consumption[time_period]:
values.append(value * self._emissions_factor[fuel_type])
results_by_time_period[time_period] = values
if demand_type == cte.DOMESTIC_HOT_WATER:
for time_period in self._building.domestic_hot_water_consumption:
values = []
for value in self._building.domestic_hot_water_consumption[time_period]:
values.append(value * self._emissions_factor[fuel_type])
results_by_time_period[time_period] = values
results[demand_type] = results_by_time_period
results_by_time_period = {}
for time_period in self._building.lighting_electrical_demand:
values = []
for value in self._building.lighting_electrical_demand[time_period]:
values.append(value * self._emissions_factor[cte.ELECTRICITY])
results_by_time_period[time_period] = values
results[cte.LIGHTING] = results_by_time_period
results_by_time_period = {}
for time_period in self._building.appliances_electrical_demand:
values = []
for value in self._building.appliances_electrical_demand[time_period]:
values.append(value * self._emissions_factor[cte.ELECTRICITY])
results_by_time_period[time_period] = values
results[cte.APPLIANCES] = results_by_time_period
return results

View File

@ -17,7 +17,7 @@ from hub.helpers.dictionaries import Dictionaries
from costs.cost import Cost
from costs.constants import SKIN_RETROFIT, SKIN_RETROFIT_AND_SYSTEM_RETROFIT_AND_PV, SYSTEM_RETROFIT_AND_PV
from costs.co2_emission import Co2Emission
class Initialize:
@ -82,10 +82,6 @@ class UnitTests(unittest.TestCase):
result = Cost(building, retrofit_scenario=SKIN_RETROFIT_AND_SYSTEM_RETROFIT_AND_PV).life_cycle
self.assertIsNotNone(result)
def test_co2_emission(self):
for building in self.init.city.buildings:
result = Co2Emission(building).operational_co2
self.assertIsNotNone(result)
def tearDown(self):
files = glob.glob('output/[!.]*')