scripts/solve_network.py: Style improvement

Co-authored-by: Fabian Neumann <fabian.neumann@outlook.de>
This commit is contained in:
lisazeyen 2022-03-17 18:15:59 +01:00 committed by GitHub
parent aed81940b3
commit 5502943301
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -189,9 +189,9 @@ def add_chp_constraints(n):
def add_pipe_retrofit_constraint(n):
"""Add constraint for retrofitting existing CH4 pipelines to H2 pipelines."""
gas_pipes_i = n.links[n.links.carrier=="gas pipeline"].query("p_nom_extendable").index
h2_retrofitted_i = n.links[n.links.carrier=='H2 pipeline retrofitted'].query("p_nom_extendable").index
h2_retrofitted_fixed_i = n.links[n.links.carrier=='H2 pipeline retrofitted'].index.difference(h2_retrofitted_i)
gas_pipes_i = n.links.query("carrier == 'gas pipeline' and p_nom_extendable").index
h2_retrofitted_i = n.links.query("carrier == 'H2 pipeline retrofitted' and p_nom_extendable").index
h2_retrofitted_fixed_i = n.links.query("carrier == 'H2 pipeline retrofitted' and not p_nom_extendable").index
if h2_retrofitted_i.empty or gas_pipes_i.empty: return