From 550256890171b0976a2f4d18468247ae035db018 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sun, 24 Sep 2023 20:35:21 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- scripts/solve_network.py | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/scripts/solve_network.py b/scripts/solve_network.py index 0adb048c..985b5ffa 100644 --- a/scripts/solve_network.py +++ b/scripts/solve_network.py @@ -645,21 +645,22 @@ def solve_network(n, config, solving, opts="", **kwargs): # check if enhanced_geothermal_performant might have changed model results if ( - snakemake.config["sector"]["enhanced_geothermal"] and - snakemake.config["sector"]["enhanced_geothermal_performant"] - ): - mask = ( - (mask := n.links.carrier == "geothermal heat") & - (n.links.loc[mask, "p_nom_max"] > 0.) + snakemake.config["sector"]["enhanced_geothermal"] + and snakemake.config["sector"]["enhanced_geothermal_performant"] + ): + mask = (mask := n.links.carrier == "geothermal heat") & ( + n.links.loc[mask, "p_nom_max"] > 0.0 ) - + saturated = n.links.loc[mask, "p_nom_max"] == n.links.loc[mask, "p_nom_opt"] if len(satbus := n.links.loc[saturated, "location"].unique()) > 0: - logger.warning(( - f"Potential for enhanced geothermal heat is saturated at bus(es): {satbus}\n" - "Consider setting config['sector']['enhanced_geothermal_performant'] to False." - )) + logger.warning( + ( + f"Potential for enhanced geothermal heat is saturated at bus(es): {satbus}\n" + "Consider setting config['sector']['enhanced_geothermal_performant'] to False." + ) + ) return n