cleaned code. not found bug. not working
This commit is contained in:
parent
f15cfff55e
commit
c9d345e1cb
|
@ -37,7 +37,6 @@ RETROFITTING_SCENARIOS = [
|
|||
SKIN_RETROFIT_AND_SYSTEM_RETROFIT_AND_PV
|
||||
]
|
||||
|
||||
EMISSION_FACTOR_GAS_QUEBEC = 0.25
|
||||
EMISSION_FACTOR_ELECTRICITY_QUEBEC = 0.0015 #https://www.cer-rec.gc.ca/en/data-analysis/energy-markets/provincial-territorial-energy-profiles/provincial-territorial-energy-profiles-quebec.html#:~:text=GHG%20Emissions,-Quebec's%20GHG%20emissions&text=The%20largest%20emitting%20sectors%20in,2.3%20MT%20CO2e.
|
||||
EMISSION_FACTOR_GAS_QUEBEC = 0.183 #https://www.canada.ca/en/environment-climate-change/services/climate-change/pricing-pollution-how-it-will-work/output-based-pricing-system/federal-greenhouse-gas-offset-system/emission-factors-reference-values.html
|
||||
EMISSION_FACTOR_BIOMASS_QUEBEC = 0.035 #Data from Spain. https://www.miteco.gob.es/es/cambio-climatico/temas/mitigacion-politicas-y-medidas/factoresemision_tcm30-479095.pdf
|
||||
|
|
|
@ -18,23 +18,20 @@ from hub.imports.usage_factory import UsageFactory
|
|||
from hub.imports.weather_factory import WeatherFactory
|
||||
from monthly_energy_balance_engine import MonthlyEnergyBalanceEngine
|
||||
from sra_engine import SraEngine
|
||||
import numpy as np
|
||||
from printing_results import *
|
||||
from hub.helpers import constants as cte
|
||||
from life_cycle_costs import LifeCycleCosts
|
||||
|
||||
from costs import CLIMATE_REFERENCE_CITY, WEATHER_FILE, WEATHER_FORMAT, CONSTRUCTION_FORMAT, USAGE_FORMAT
|
||||
from costs import ENERGY_SYSTEM_FORMAT, ATTIC_HEATED_CASE, BASEMENT_HEATED_CASE, RETROFITTING_SCENARIOS, NUMBER_OF_YEARS
|
||||
from costs import CONSTRUCTION_FORMAT
|
||||
from costs import ENERGY_SYSTEM_FORMAT, RETROFITTING_SCENARIOS, NUMBER_OF_YEARS
|
||||
from costs import CONSUMER_PRICE_INDEX, ELECTRICITY_PEAK_INDEX, ELECTRICITY_PRICE_INDEX, GAS_PRICE_INDEX, DISCOUNT_RATE
|
||||
from costs import SKIN_RETROFIT, SYSTEM_RETROFIT_AND_PV, SKIN_RETROFIT_AND_SYSTEM_RETROFIT_AND_PV
|
||||
from costs import RETROFITTING_YEAR_CONSTRUCTION
|
||||
|
||||
from costs import EMISSION_FACTOR_GAS_QUEBEC, EMISSION_FACTOR_ELECTRICITY_QUEBEC, EMISSION_FACTOR_GAS_QUEBEC,\
|
||||
EMISSION_FACTOR_BIOMASS_QUEBEC, EMISSION_FACTOR_FUEL_OIL_QUEBEC, EMISSION_FACTOR_DIESEL_QUEBEC
|
||||
|
||||
# import paths
|
||||
from results import Results
|
||||
|
||||
|
||||
def _npv_from_list(npv_discount_rate, list_cashflow):
|
||||
lcc_value = npf.npv(npv_discount_rate, list_cashflow)
|
||||
return lcc_value
|
||||
|
@ -147,6 +144,8 @@ for retrofitting_scenario in RETROFITTING_SCENARIOS:
|
|||
global_operational_incomes.to_excel(writer, sheet_name='global_operational_incomes')
|
||||
global_capital_incomes.to_excel(writer, sheet_name='global_capital_incomes')
|
||||
|
||||
investmentcosts = pd.DataFrame([])
|
||||
print('RETROFITTING SCENARIO', retrofitting_scenario)
|
||||
if retrofitting_scenario == 0:
|
||||
investmentcosts = [global_capital_costs['B2010_opaque_walls'][0],
|
||||
global_capital_costs['B2020_transparent'][0],
|
||||
|
@ -158,9 +157,9 @@ for retrofitting_scenario in RETROFITTING_SCENARIOS:
|
|||
global_capital_costs['D301010_photovoltaic_system'][0]]
|
||||
investmentcosts = pd.DataFrame(investmentcosts)
|
||||
|
||||
|
||||
else:
|
||||
investmentcosts[f'retrofitting_scenario {retrofitting_scenario}'] = [global_capital_costs['B2010_opaque_walls'][0],
|
||||
investmentcosts[f'retrofitting_scenario_{retrofitting_scenario}'] = \
|
||||
[global_capital_costs['B2010_opaque_walls'][0],
|
||||
global_capital_costs['B2020_transparent'][0],
|
||||
global_capital_costs['B3010_opaque_roof'][0],
|
||||
global_capital_costs['B10_superstructure'][0],
|
||||
|
@ -242,7 +241,7 @@ for retrofitting_scenario in RETROFITTING_SCENARIOS:
|
|||
|
||||
print(f'Scenario {retrofitting_scenario} {life_cycle_costs}')
|
||||
|
||||
printing_results(investmentcosts,life_cycle_results,total_floor_area)
|
||||
# printing_results(investmentcosts, life_cycle_results, total_floor_area)
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -102,7 +102,6 @@ class LifeCycleCosts:
|
|||
surface_transparent += thermal_boundary.opaque_area * thermal_boundary.window_ratio
|
||||
|
||||
chapters = archetype.capital_cost
|
||||
print('kk')
|
||||
peak_heating = building.heating_peak_load[cte.YEAR][0]/1000
|
||||
peak_cooling = building.cooling_peak_load[cte.YEAR][0]/1000
|
||||
# todo: change area pv when the variable exists
|
||||
|
|
|
@ -1,16 +1,14 @@
|
|||
import numpy as np
|
||||
|
||||
import plotly.graph_objects as go
|
||||
import plotly.offline as offline
|
||||
import matplotlib.pyplot as plt
|
||||
import plotly.express as px
|
||||
|
||||
|
||||
def printing_results(investmentcosts, life_cycle_results,total_floor_area):
|
||||
|
||||
labels = investmentcosts.index
|
||||
values = investmentcosts['retrofitting_scenario 1']
|
||||
values2 = investmentcosts['retrofitting_scenario 2']
|
||||
values3 = investmentcosts['retrofitting_scenario 3']
|
||||
values = investmentcosts['retrofitting_scenario_1']
|
||||
values2 = investmentcosts['retrofitting_scenario_2']
|
||||
values3 = investmentcosts['retrofitting_scenario_3']
|
||||
|
||||
fig = go.Figure(data=[go.Pie(labels=labels, values=values)])
|
||||
fig2 = go.Figure(data=[go.Pie(labels=labels, values=values2)])
|
||||
|
@ -21,11 +19,11 @@ def printing_results(investmentcosts, life_cycle_results,total_floor_area):
|
|||
showlegend=True
|
||||
)
|
||||
fig2.update_layout(
|
||||
title='Retrofitting scenario 1',
|
||||
title='Retrofitting scenario 2',
|
||||
showlegend=True
|
||||
)
|
||||
fig3.update_layout(
|
||||
title='Retrofitting scenario 1',
|
||||
title='Retrofitting scenario 3',
|
||||
showlegend=True
|
||||
)
|
||||
|
||||
|
|
4
out_files/.gitignore
vendored
Normal file
4
out_files/.gitignore
vendored
Normal file
|
@ -0,0 +1,4 @@
|
|||
# Ignore everything in this directory
|
||||
.gitignore
|
||||
# Except this file
|
||||
!.gitignore
|
Loading…
Reference in New Issue
Block a user