updated to last hub version

This commit is contained in:
Pilar Monsalvete 2023-08-08 13:32:45 -04:00
parent e629196280
commit 4d3cdf6d8d

View File

@ -15,9 +15,10 @@ class Co2Emission:
def __init__(self, building: Building, emissions_factor=None): def __init__(self, building: Building, emissions_factor=None):
if emissions_factor is None: if emissions_factor is None:
emissions_factor = {cte.GAS: 0.2025, # kgCO2 / J
cte.ELECTRICITY: 0.00113, emissions_factor = {cte.GAS: 56.25480769E-9,
cte.DIESEL: 0.2683, cte.ELECTRICITY: 0.313840909E-9,
cte.DIESEL: 74.52882883E-9,
cte.RENEWABLE: 0} cte.RENEWABLE: 0}
self._emissions_factor = emissions_factor self._emissions_factor = emissions_factor
self._building = building self._building = building
@ -65,7 +66,7 @@ class Co2Emission:
results_by_time_period = {} results_by_time_period = {}
for time_period in self._building.lighting_electrical_demand: for time_period in self._building.lighting_electrical_demand:
values = [] values = []
for value in self._building.lighting_electrical_demand[time_period]['insel meb']: for value in self._building.lighting_electrical_demand[time_period]:
values.append(value * self._emissions_factor[cte.ELECTRICITY]) values.append(value * self._emissions_factor[cte.ELECTRICITY])
results_by_time_period[time_period] = values results_by_time_period[time_period] = values
results[cte.LIGHTING] = results_by_time_period results[cte.LIGHTING] = results_by_time_period
@ -73,7 +74,7 @@ class Co2Emission:
results_by_time_period = {} results_by_time_period = {}
for time_period in self._building.appliances_electrical_demand: for time_period in self._building.appliances_electrical_demand:
values = [] values = []
for value in self._building.appliances_electrical_demand[time_period]['insel meb']: for value in self._building.appliances_electrical_demand[time_period]:
values.append(value * self._emissions_factor[cte.ELECTRICITY]) values.append(value * self._emissions_factor[cte.ELECTRICITY])
results_by_time_period[time_period] = values results_by_time_period[time_period] = values
results[cte.APPLIANCES] = results_by_time_period results[cte.APPLIANCES] = results_by_time_period