Merge pull request #1002 from PyPSA/rename-existing-capacities

Rename existing capacities
This commit is contained in:
lisazeyen 2024-04-03 17:17:30 +02:00 committed by GitHub
commit 282651cfba
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 12 additions and 2 deletions

View File

@ -172,6 +172,8 @@ Upcoming Release
* Fix error with `symbol` of `buses` in `simplify_network`. * Fix error with `symbol` of `buses` in `simplify_network`.
* Fix index of existing capacities in `add_power_capacities_installed_before_baseyear` with `m` option.
PyPSA-Eur 0.10.0 (19th February 2024) PyPSA-Eur 0.10.0 (19th February 2024)
===================================== =====================================

View File

@ -259,13 +259,21 @@ 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 for i in inv_ind if (i + name_suffix) in n.generators.index i
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 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",