Merge branch 'feature/rename-existing-capacities' of github.com:Climact/pypsa-eur-climact into Climact-feature/rename-existing-capacities

This commit is contained in:
Fabian Neumann 2024-05-13 10:09:21 +02:00
commit 22b16d54e9
3 changed files with 9 additions and 19 deletions

View File

@ -220,6 +220,7 @@ Upcoming Release
* Add documentation section for how to contribute documentation * Add documentation section for how to contribute documentation
* Clarify suffix usage in `add_existing_baseyear`.
PyPSA-Eur 0.10.0 (19th February 2024) PyPSA-Eur 0.10.0 (19th February 2024)
===================================== =====================================

View File

@ -163,7 +163,7 @@ def add_power_capacities_installed_before_baseyear(n, grouping_years, costs, bas
technology_to_drop = ["Pv", "Storage Technologies"] technology_to_drop = ["Pv", "Storage Technologies"]
# drop unused fueltyps and technologies # drop unused fueltypes and technologies
df_agg.drop(df_agg.index[df_agg.Fueltype.isin(fueltype_to_drop)], inplace=True) df_agg.drop(df_agg.index[df_agg.Fueltype.isin(fueltype_to_drop)], inplace=True)
df_agg.drop(df_agg.index[df_agg.Technology.isin(technology_to_drop)], inplace=True) df_agg.drop(df_agg.index[df_agg.Technology.isin(technology_to_drop)], inplace=True)
df_agg.Fueltype = df_agg.Fueltype.map(rename_fuel) df_agg.Fueltype = df_agg.Fueltype.map(rename_fuel)
@ -252,6 +252,7 @@ def add_power_capacities_installed_before_baseyear(n, grouping_years, costs, bas
] ]
suffix = "-ac" if generator == "offwind" else "" suffix = "-ac" if generator == "offwind" else ""
name_suffix = f" {generator}{suffix}-{grouping_year}" name_suffix = f" {generator}{suffix}-{grouping_year}"
name_suffix_by = f" {generator}{suffix}-{baseyear}"
asset_i = capacity.index + name_suffix asset_i = capacity.index + name_suffix
if generator in ["solar", "onwind", "offwind"]: if generator in ["solar", "onwind", "offwind"]:
# to consider electricity grid connection costs or a split between # to consider electricity grid connection costs or a split between
@ -281,21 +282,11 @@ def add_power_capacities_installed_before_baseyear(n, grouping_years, costs, bas
# for offshore the splitting only includes coastal regions # for offshore the splitting only includes coastal regions
inv_ind = [ inv_ind = [
i i for i in inv_ind if (i + name_suffix_by) in n.generators.index
for i in inv_ind
if (i + name_suffix)
in n.generators.index.str.replace(
str(baseyear), str(grouping_year)
)
] ]
p_max_pu = n.generators_t.p_max_pu[ p_max_pu = n.generators_t.p_max_pu[[i + name_suffix_by for i in inv_ind]]
[i + name_suffix for i in inv_ind] p_max_pu.columns = [i + name_suffix for i in inv_ind]
]
p_max_pu.columns = [
i + name_suffix.replace(str(grouping_year), str(baseyear))
for i in inv_ind
]
n.madd( n.madd(
"Generator", "Generator",
@ -313,9 +304,7 @@ def add_power_capacities_installed_before_baseyear(n, grouping_years, costs, bas
) )
else: else:
p_max_pu = n.generators_t.p_max_pu[ p_max_pu = n.generators_t.p_max_pu[capacity.index + name_suffix_by]
capacity.index + f" {generator}{suffix}-{baseyear}"
]
if not new_build.empty: if not new_build.empty:
n.madd( n.madd(
@ -441,7 +430,7 @@ def add_heating_capacities_installed_before_baseyear(
linear decommissioning of heating capacities from 2020 to 2045 is linear decommissioning of heating capacities from 2020 to 2045 is
currently assumed heating capacities split between residential and currently assumed heating capacities split between residential and
services proportional to heating load in both 50% capacities services proportional to heating load in both 50% capacities
in rural busess 50% in urban buses in rural buses 50% in urban buses
""" """
logger.debug(f"Adding heating capacities installed before {baseyear}") logger.debug(f"Adding heating capacities installed before {baseyear}")

View File

@ -313,7 +313,7 @@ def chemicals_industry():
df.loc["methane", sector] += s_fec["Natural gas"] df.loc["methane", sector] += s_fec["Natural gas"]
# LPG and other feedstock materials are assimilated to naphtha # LPG and other feedstock materials are assimilated to naphtha
# since they will be produced through Fischer-Tropsh process # since they will be produced through Fischer-Tropsch process
sel = [ sel = [
"Solids", "Solids",
"Refinery gas", "Refinery gas",