diff --git a/doc/release_notes.rst b/doc/release_notes.rst index be6be9fd..52b2ddc2 100644 --- a/doc/release_notes.rst +++ b/doc/release_notes.rst @@ -12,7 +12,7 @@ Upcoming Release * New configuration option ``everywhere_powerplants`` to build conventional powerplants everywhere, irrespective of existing powerplants locations, in the network (https://github.com/PyPSA/pypsa-eur/pull/850). -* Remove option for wave energy as technology data is not maintained. +* Remove option for wave energy as technology data is not maintained. PyPSA-Eur 0.9.0 (5th January 2024) diff --git a/scripts/solve_network.py b/scripts/solve_network.py index db842054..0b503644 100644 --- a/scripts/solve_network.py +++ b/scripts/solve_network.py @@ -796,8 +796,8 @@ def add_pipe_retrofit_constraint(n): def add_co2_atmosphere_constraint(n, snapshots): - glcs = n.global_constraints[n.global_constraints.type=="co2_atmosphere"] - + glcs = n.global_constraints[n.global_constraints.type == "co2_atmosphere"] + if glcs.empty: return for name, glc in glcs.iterrows(): @@ -812,11 +812,12 @@ def add_co2_atmosphere_constraint(n, snapshots): stores = n.stores.query("carrier in @emissions.index and not e_cyclic") if not stores.empty: last_i = snapshots[-1] - lhs = n.model["Store-e"].loc[last_i, stores.index] + lhs = n.model["Store-e"].loc[last_i, stores.index] rhs = glc.constant - + n.model.add_constraints(lhs <= rhs, name=f"GlobalConstraint-{name}") + def extra_functionality(n, snapshots): """ Collects supplementary constraints which will be passed to