From 5502943301aaa3126a2575a22db21f0bbcaf18ec Mon Sep 17 00:00:00 2001 From: lisazeyen <35347358+lisazeyen@users.noreply.github.com> Date: Thu, 17 Mar 2022 18:15:59 +0100 Subject: [PATCH] scripts/solve_network.py: Style improvement Co-authored-by: Fabian Neumann --- scripts/solve_network.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/solve_network.py b/scripts/solve_network.py index 5108e2ee..7ea0f064 100644 --- a/scripts/solve_network.py +++ b/scripts/solve_network.py @@ -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