diff --git a/rules/common.smk b/rules/common.smk index 0e85b620..2298ff91 100644 --- a/rules/common.smk +++ b/rules/common.smk @@ -4,7 +4,7 @@ import os, sys, glob -helper_source_path = [match for match in glob.glob('**/_helpers.py', recursive=True)] +helper_source_path = [match for match in glob.glob("**/_helpers.py", recursive=True)] for path in helper_source_path: path = os.path.dirname(os.path.abspath(path)) diff --git a/scripts/add_brownfield.py b/scripts/add_brownfield.py index e151c441..cb1f51c8 100644 --- a/scripts/add_brownfield.py +++ b/scripts/add_brownfield.py @@ -133,9 +133,7 @@ def disable_grid_expansion_if_LV_limit_hit(n): # allow small numerical differences if lv_limit - total_expansion < 1: - logger.info( - f"LV is already reached, disabling expansion and LV limit" - ) + logger.info(f"LV is already reached, disabling expansion and LV limit") extendable_acs = n.lines.query("s_nom_extendable").index n.lines.loc[extendable_acs, "s_nom_extendable"] = False n.lines.loc[extendable_acs, "s_nom"] = n.lines.loc[extendable_acs, "s_nom_min"] diff --git a/scripts/prepare_sector_network.py b/scripts/prepare_sector_network.py index 79bc67e9..8a45da2e 100644 --- a/scripts/prepare_sector_network.py +++ b/scripts/prepare_sector_network.py @@ -3000,8 +3000,9 @@ def add_industry(n, costs): if options["co2_spatial"] or options["co2network"]: p_set = ( - -industrial_demand.loc[nodes, "process emission"] - .rename(index=lambda x: x + " process emissions") + -industrial_demand.loc[nodes, "process emission"].rename( + index=lambda x: x + " process emissions" + ) / nhours ) else: @@ -3414,6 +3415,7 @@ def cluster_heat_buses(n): pnl = c.pnl agg = define_clustering(pd.Index(pnl.keys()), aggregate_dict) for k in pnl.keys(): + def renamer(s): return s.replace("residential ", "").replace("services ", "") diff --git a/scripts/solve_network.py b/scripts/solve_network.py index 203d8b0f..aa802ea8 100644 --- a/scripts/solve_network.py +++ b/scripts/solve_network.py @@ -856,7 +856,7 @@ def solve_network(n, config, solving, opts="", **kwargs): kwargs["assign_all_duals"] = cf_solving.get("assign_all_duals", False) if kwargs["solver_name"] == "gurobi": - logging.getLogger('gurobipy').setLevel(logging.CRITICAL) + logging.getLogger("gurobipy").setLevel(logging.CRITICAL) rolling_horizon = cf_solving.pop("rolling_horizon", False) skip_iterations = cf_solving.pop("skip_iterations", False)