From a892f0c0eccaf1026a9bb999f018039a576e5f9b Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sun, 12 Nov 2023 20:15:04 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- scripts/prepare_sector_network.py | 15 +++++++++------ scripts/solve_network.py | 14 ++++++-------- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/scripts/prepare_sector_network.py b/scripts/prepare_sector_network.py index 5d6c40e8..79b8c6af 100644 --- a/scripts/prepare_sector_network.py +++ b/scripts/prepare_sector_network.py @@ -3473,25 +3473,28 @@ def add_enhanced_geothermal( p_nom_extendable=True, ) else: - n.links.at[bus + " geothermal organic rankine cycle", "efficiency"] = efficiency_orc + n.links.at[ + bus + " geothermal organic rankine cycle", "efficiency" + ] = efficiency_orc if snakemake.params.sector["enhanced_geothermal_flexible"]: - # this StorageUnit represents flexible operation using the geothermal reservoir. # Hence, it is intuitively wrong to install it at the surface bus, # this is however the more lean and computationally efficient solution. - - max_hours = snakemake.params.sector["enhanced_geothermal_reservoir_max_hours"] + + max_hours = snakemake.params.sector[ + "enhanced_geothermal_reservoir_max_hours" + ] boost = snakemake.params.sector["enhanced_geothermal_reservoir_max_boost"] max_hours = max_hours * boost n.add( "StorageUnit", - bus + ' geothermal reservoir', + bus + " geothermal reservoir", bus=f"geothermal heat surface {bus}", carrier="geothermal heat", p_nom_extendable=True, - p_min_pu=-1. - boost, + p_min_pu=-1.0 - boost, max_hours=max_hours, ) diff --git a/scripts/solve_network.py b/scripts/solve_network.py index 3c29e295..deb456c5 100644 --- a/scripts/solve_network.py +++ b/scripts/solve_network.py @@ -779,15 +779,13 @@ def add_geothermal_chp_constraint(n): def add_flexible_egs_constraint(n): - well_index = n.links.loc[n.links.carrier == 'geothermal heat'].index - storage_index = n.storage_units.loc[n.storage_units.carrier == 'geothermal heat '].index + well_index = n.links.loc[n.links.carrier == "geothermal heat"].index + storage_index = n.storage_units.loc[ + n.storage_units.carrier == "geothermal heat " + ].index - p_nom_rhs = ( - n.model["Link-p_nom"].loc[well_index] - ) - p_nom_lhs = ( - n.model["StorageUnit-p_nom"].loc[storage_index] - ) + p_nom_rhs = n.model["Link-p_nom"].loc[well_index] + p_nom_lhs = n.model["StorageUnit-p_nom"].loc[storage_index] n.model.add_constraints( p_nom_lhs <= p_nom_rhs,