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

Rename existing capacities #1002

Merged
merged 4 commits into from
Apr 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
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
Loading