Skip to content

Commit

Permalink
Merge pull request #1002 from PyPSA/rename-existing-capacities
Browse files Browse the repository at this point in the history
Rename existing capacities
  • Loading branch information
lisazeyen authored Apr 3, 2024
2 parents fdfd97a + d8fbc6d commit 282651c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 2 additions & 0 deletions doc/release_notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,8 @@ Upcoming Release

* 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)
=====================================

Expand Down
12 changes: 10 additions & 2 deletions scripts/add_existing_baseyear.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,13 +259,21 @@ def add_power_capacities_installed_before_baseyear(n, grouping_years, costs, bas

# for offshore the splitting only includes coastal regions
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[
[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(
"Generator",
Expand Down

0 comments on commit 282651c

Please sign in to comment.