Complete basic clean up and warning removal

This commit is contained in:
Guille Gutierrez 2023-05-31 10:49:17 -04:00
parent 3fd0202f7a
commit 1f35c31f24
2 changed files with 38 additions and 29 deletions

View File

@ -197,19 +197,22 @@ class LifeCycleCosts:
domestic_hot_water_electricity = 0 domestic_hot_water_electricity = 0
if self._fuel_type == 1: if self._fuel_type == 1:
fixed_gas_cost_year_0 = archetype.operational_cost.fuels[1].fixed_monthly fixed_gas_cost_year_0 = archetype.operational_cost.fuels[1].fixed_monthly
variable_gas_cost_year_0 = (building.heating_consumption[cte.YEAR][0] + variable_gas_cost_year_0 = (
building.domestic_hot_water_consumption[cte.YEAR][0]) / (1000) * \ (building.heating_consumption[cte.YEAR][0] + building.domestic_hot_water_consumption[cte.YEAR][0]) / 1000 *
archetype.operational_cost.fuels[1].variable[0] archetype.operational_cost.fuels[1].variable[0]
)
if self._fuel_type == 0: if self._fuel_type == 0:
electricity_heating = building.heating_consumption[cte.YEAR][0] / (1000) electricity_heating = building.heating_consumption[cte.YEAR][0] / 1000
domestic_hot_water_electricity = building.domestic_hot_water_consumption[cte.YEAR][0] / 1000 domestic_hot_water_electricity = building.domestic_hot_water_consumption[cte.YEAR][0] / 1000
electricity_cooling = building.cooling_consumption[cte.YEAR][0] / (1000) electricity_cooling = building.cooling_consumption[cte.YEAR][0] / 1000
electricity_lighting = building.lighting_electrical_demand[cte.YEAR]['insel meb'] / 1000 electricity_lighting = building.lighting_electrical_demand[cte.YEAR]['insel meb'] / 1000
electricity_plug_loads = building.appliances_electrical_demand[cte.YEAR]['insel meb'] / 1000 electricity_plug_loads = building.appliances_electrical_demand[cte.YEAR]['insel meb'] / 1000
electricity_distribution = 0 # building.distribution_systems_electrical_consumption[cte.YEAR][0]/1000 electricity_distribution = 0 # building.distribution_systems_electrical_consumption[cte.YEAR][0]/1000
total_electricity_consumption = electricity_heating + electricity_cooling + electricity_lighting + \ total_electricity_consumption = (
domestic_hot_water_electricity + electricity_plug_loads + electricity_distribution electricity_heating + electricity_cooling + electricity_lighting + domestic_hot_water_electricity +
electricity_plug_loads + electricity_distribution
)
# todo: change when peak electricity demand is coded. Careful with factor residential # todo: change when peak electricity demand is coded. Careful with factor residential
peak_electricity_demand = 100 # self._peak_electricity_demand peak_electricity_demand = 100 # self._peak_electricity_demand
@ -224,27 +227,28 @@ class LifeCycleCosts:
price_increase_electricity += math.pow(1 + self._electricity_price_index, year) price_increase_electricity += math.pow(1 + self._electricity_price_index, year)
price_increase_peak_electricity += math.pow(1 + self._electricity_peak_index, year) price_increase_peak_electricity += math.pow(1 + self._electricity_peak_index, year)
price_increase_gas += math.pow(1 + self._gas_price_index, year) price_increase_gas += math.pow(1 + self._gas_price_index, year)
self._yearly_operational_costs.at[year, 'Fixed_costs_electricity_peak'] = peak_electricity_cost_year_0 * \ self._yearly_operational_costs.at[year, 'Fixed_costs_electricity_peak'] = (
price_increase_peak_electricity peak_electricity_cost_year_0 * price_increase_peak_electricity
)
self._yearly_operational_costs.at[year, 'Fixed_costs_electricity_monthly'] = monthly_electricity_cost_year_0 * \ self._yearly_operational_costs.at[year, 'Fixed_costs_electricity_monthly'] = (
price_increase_peak_electricity monthly_electricity_cost_year_0 * price_increase_peak_electricity
)
self._yearly_operational_costs.at[year, 'Variable_costs_electricity'] = float( self._yearly_operational_costs.at[year, 'Variable_costs_electricity'] = float(
variable_electricity_cost_year_0 * price_increase_electricity variable_electricity_cost_year_0 * price_increase_electricity
) )
self._yearly_operational_costs.at[year, 'Fixed_costs_gas'] = fixed_gas_cost_year_0 * \ self._yearly_operational_costs.at[year, 'Fixed_costs_gas'] = fixed_gas_cost_year_0 * price_increase_gas
price_increase_gas self._yearly_operational_costs.at[year, 'Variable_costs_gas'] = (
self._yearly_operational_costs.at[year, 'Variable_costs_gas'] = variable_gas_cost_year_0 * \ variable_gas_cost_year_0 * price_increase_peak_electricity
price_increase_peak_electricity )
self._yearly_operational_costs.at[year, 'Variable_costs_gas'] = variable_gas_cost_year_0 * \ self._yearly_operational_costs.at[year, 'Variable_costs_gas'] = (
price_increase_peak_electricity variable_gas_cost_year_0 * price_increase_peak_electricity
)
self._yearly_operational_costs.fillna(0, inplace=True) self._yearly_operational_costs.fillna(0, inplace=True)
return self._yearly_operational_costs return self._yearly_operational_costs
def calculate_total_operational_incomes(self): def calculate_total_operational_incomes(self):
building = self._building building = self._building
archetype = self._archetype
if cte.YEAR not in building.onsite_electrical_production: if cte.YEAR not in building.onsite_electrical_production:
onsite_electricity_production = 0 onsite_electricity_production = 0
else: else:
@ -254,8 +258,9 @@ class LifeCycleCosts:
for year in range(1, self._number_of_years + 1): for year in range(1, self._number_of_years + 1):
price_increase_electricity += math.pow(1 + self._electricity_price_index, year) price_increase_electricity += math.pow(1 + self._electricity_price_index, year)
self._yearly_operational_incomes.loc[year, 'Incomes electricity'] = onsite_electricity_production * \ self._yearly_operational_incomes.loc[year, 'Incomes electricity'] = (
price_increase_electricity onsite_electricity_production * price_increase_electricity
)
self._yearly_operational_incomes.fillna(0, inplace=True) self._yearly_operational_incomes.fillna(0, inplace=True)
return self._yearly_operational_incomes return self._yearly_operational_incomes
@ -278,11 +283,14 @@ class LifeCycleCosts:
for year in range(1, self._number_of_years + 1): for year in range(1, self._number_of_years + 1):
costs_increase = math.pow(1 + self._consumer_price_index, year) costs_increase = math.pow(1 + self._consumer_price_index, year)
self._yearly_maintenance_costs.loc[year, 'Heating_maintenance'] = maintenance_heating_0 * \ self._yearly_maintenance_costs.loc[year, 'Heating_maintenance'] = (
costs_increase maintenance_heating_0 * costs_increase
self._yearly_maintenance_costs.loc[year, 'Cooling_maintenance'] = maintenance_cooling_0 * \ )
costs_increase self._yearly_maintenance_costs.loc[year, 'Cooling_maintenance'] = (
self._yearly_maintenance_costs.loc[year, 'PV_maintenance'] = maintenance_pv_0 * \ maintenance_cooling_0 * costs_increase
costs_increase )
self._yearly_maintenance_costs.loc[year, 'PV_maintenance'] = (
maintenance_pv_0 * costs_increase
)
self._yearly_maintenance_costs.fillna(0, inplace=True) self._yearly_maintenance_costs.fillna(0, inplace=True)
return self._yearly_maintenance_costs return self._yearly_maintenance_costs

View File

@ -1 +1,2 @@
numpy_financial numpy_financial
cerc_hub