Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve inputs for buildings retrofit calculations #800

Open
wants to merge 22 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions rules/build_sector.smk
Original file line number Diff line number Diff line change
Expand Up @@ -608,10 +608,9 @@ if config["sector"]["retrofitting"]["retro_endogen"]:
retrofitting=config["sector"]["retrofitting"],
countries=config["countries"],
input:
building_stock="data/retro/data_building_stock.csv",
building_stock="data/retro/building_stock_2023.csv",
martacki marked this conversation as resolved.
Show resolved Hide resolved
data_tabula="data/bundle-sector/retro/tabula-calculator-calcsetbuilding.csv",
air_temperature=RESOURCES + "temp_air_total_elec_s{simpl}_{clusters}.nc",
u_values_PL="data/retro/u_values_poland.csv",
tax_w="data/retro/electricity_taxes_eu.csv",
construction_index="data/retro/comparative_level_investment.csv",
floor_area_missing="data/retro/floor_area_missing.csv",
Expand Down
31 changes: 4 additions & 27 deletions scripts/build_retro_cost.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,10 @@ def prepare_building_stock_data():
type and period

"""
building_data = pd.read_csv(snakemake.input.building_stock, usecols=list(range(13)))
# building_data = pd.read_csv(snakemake.input.building_stock, usecols=list(range(13)))
building_data = pd.read_csv(
snakemake.input.building_stock, sep="|", usecols=list(range(13))
)

# standardize data
building_data["type"].replace(
Expand Down Expand Up @@ -258,32 +261,6 @@ def prepare_building_stock_data():
else:
area_tot.loc[averaged_data.index] = averaged_data

# u_values for Poland are missing -> take them from eurostat -----------
u_values_PL = pd.read_csv(snakemake.input.u_values_PL)
u_values_PL.component.replace({"Walls": "Wall", "Windows": "Window"}, inplace=True)
area_PL = area.loc["Poland"].reset_index()
data_PL = pd.DataFrame(columns=u_values.columns, index=area_PL.index)
data_PL["country"] = "Poland"
data_PL["country_code"] = "PL"
# data from area
for col in ["sector", "subsector", "bage"]:
data_PL[col] = area_PL[col]
data_PL["btype"] = area_PL["subsector"]

data_PL_final = pd.DataFrame()
for component in components:
data_PL["type"] = component
data_PL["value"] = data_PL.apply(
lambda x: u_values_PL[
(u_values_PL.component == component)
& (u_values_PL.sector == x["sector"])
][x["bage"]].iloc[0],
axis=1,
)
data_PL_final = pd.concat([data_PL_final, data_PL])

u_values = pd.concat([u_values, data_PL_final]).reset_index(drop=True)

# clean data ---------------------------------------------------------------
# smallest possible today u values for windows 0.8 (passive house standard)
# maybe the u values for the glass and not the whole window including frame
Expand Down
Loading