Skip to content

Commit 38ff9db

Browse files
Align to pypsa v1 api changes (#1722)
* fix: make workflow compatible with optimization framework changes * refac: rename to pypsa_v1 * fix: follow up
1 parent 478b7ab commit 38ff9db

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

scripts/solve_network.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -402,8 +402,12 @@ def add_retrofit_gas_boiler_constraint(
402402
dispatch = n.model["Link-p"]
403403
active = get_activity_mask(n, c, snapshots, gas_i)
404404
rhs = rhs[active]
405-
p_gas = dispatch.sel(Link=gas_i)
406-
p_h2 = dispatch.sel(Link=h2_i)
405+
if PYPSA_V1:
406+
p_gas = dispatch.sel(name=gas_i)
407+
p_h2 = dispatch.sel(name=h2_i)
408+
else:
409+
p_gas = dispatch.sel(Link=gas_i)
410+
p_h2 = dispatch.sel(Link=h2_i)
407411

408412
lhs = p_gas + p_h2
409413

0 commit comments

Comments
 (0)