Fix gas network retrofit

This commit is contained in:
Thomas Gilon 2024-04-23 13:58:24 +02:00
parent 5ecd56d53c
commit cc49926a23
2 changed files with 38 additions and 36 deletions

View File

@ -181,6 +181,8 @@ Upcoming Release
* Fix custom busmap read in `cluster_network`. * Fix custom busmap read in `cluster_network`.
* Fix gas network retrofitting in `add_brownfield`.
PyPSA-Eur 0.10.0 (19th February 2024) PyPSA-Eur 0.10.0 (19th February 2024)
===================================== =====================================

View File

@ -107,7 +107,7 @@ def add_brownfield(n, n_p, year):
# already retrofitted capacity from gas -> H2 # already retrofitted capacity from gas -> H2
already_retrofitted = ( already_retrofitted = (
n.links.loc[h2_retrofitted_fixed_i, "p_nom"] n.links.loc[h2_retrofitted_fixed_i, "p_nom"]
.rename(lambda x: x.split("-2")[0].replace(fr, to)) .rename(lambda x: x.split("-2")[0].replace(fr, to) + f"-{year}")
.groupby(level=0) .groupby(level=0)
.sum() .sum()
) )