[pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci
This commit is contained in:
pre-commit-ci[bot] 2024-01-12 20:34:54 +00:00
parent 0a789a22dc
commit 0bac08934a
2 changed files with 6 additions and 5 deletions

View File

@ -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)

View File

@ -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