[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-04 19:18:59 +00:00
parent 9d0040912b
commit 7b1600164f
6 changed files with 12 additions and 18 deletions

View File

@ -90,13 +90,10 @@ rule build_gas_input_locations:
), ),
entry="data/gas_network/scigrid-gas/data/IGGIELGN_BorderPoints.geojson", entry="data/gas_network/scigrid-gas/data/IGGIELGN_BorderPoints.geojson",
storage="data/gas_network/scigrid-gas/data/IGGIELGN_Storages.geojson", storage="data/gas_network/scigrid-gas/data/IGGIELGN_Storages.geojson",
regions_onshore=RESOURCES regions_onshore=RESOURCES + "regions_onshore_elec_s{simpl}_{clusters}.geojson",
+ "regions_onshore_elec_s{simpl}_{clusters}.geojson", regions_offshore=RESOURCES + "regions_offshore_elec_s{simpl}_{clusters}.geojson",
regions_offshore=RESOURCES
+ "regions_offshore_elec_s{simpl}_{clusters}.geojson",
output: output:
gas_input_nodes=RESOURCES gas_input_nodes=RESOURCES + "gas_input_locations_s{simpl}_{clusters}.geojson",
+ "gas_input_locations_s{simpl}_{clusters}.geojson",
gas_input_nodes_simplified=RESOURCES gas_input_nodes_simplified=RESOURCES
+ "gas_input_locations_s{simpl}_{clusters}_simplified.csv", + "gas_input_locations_s{simpl}_{clusters}_simplified.csv",
resources: resources:
@ -112,10 +109,8 @@ rule build_gas_input_locations:
rule cluster_gas_network: rule cluster_gas_network:
input: input:
cleaned_gas_network=RESOURCES + "gas_network.csv", cleaned_gas_network=RESOURCES + "gas_network.csv",
regions_onshore=RESOURCES regions_onshore=RESOURCES + "regions_onshore_elec_s{simpl}_{clusters}.geojson",
+ "regions_onshore_elec_s{simpl}_{clusters}.geojson", regions_offshore=RESOURCES + "regions_offshore_elec_s{simpl}_{clusters}.geojson",
regions_offshore=RESOURCES
+ "regions_offshore_elec_s{simpl}_{clusters}.geojson",
output: output:
clustered_gas_network=RESOURCES + "gas_network_elec_s{simpl}_{clusters}.csv", clustered_gas_network=RESOURCES + "gas_network_elec_s{simpl}_{clusters}.csv",
resources: resources:

View File

@ -4,7 +4,7 @@
import os, sys, glob 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: for path in helper_source_path:
path = os.path.dirname(os.path.abspath(path)) path = os.path.dirname(os.path.abspath(path))

View File

@ -163,7 +163,6 @@ if config["enable"]["retrieve"] and config["enable"].get(
if config["enable"]["retrieve"]: if config["enable"]["retrieve"]:
datafiles = [ datafiles = [
"IGGIELGN_LNGs.geojson", "IGGIELGN_LNGs.geojson",
"IGGIELGN_BorderPoints.geojson", "IGGIELGN_BorderPoints.geojson",

View File

@ -133,9 +133,7 @@ def disable_grid_expansion_if_LV_limit_hit(n):
# allow small numerical differences # allow small numerical differences
if lv_limit - total_expansion < 1: if lv_limit - total_expansion < 1:
logger.info( logger.info(f"LV is already reached, disabling expansion and LV limit")
f"LV is already reached, disabling expansion and LV limit"
)
extendable_acs = n.lines.query("s_nom_extendable").index 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_extendable"] = False
n.lines.loc[extendable_acs, "s_nom"] = n.lines.loc[extendable_acs, "s_nom_min"] n.lines.loc[extendable_acs, "s_nom"] = n.lines.loc[extendable_acs, "s_nom_min"]

View File

@ -2998,8 +2998,9 @@ def add_industry(n, costs):
if options["co2_spatial"] or options["co2network"]: if options["co2_spatial"] or options["co2network"]:
p_set = ( p_set = (
-industrial_demand.loc[nodes, "process emission"] -industrial_demand.loc[nodes, "process emission"].rename(
.rename(index=lambda x: x + " process emissions") index=lambda x: x + " process emissions"
)
/ nhours / nhours
) )
else: else:
@ -3412,6 +3413,7 @@ def cluster_heat_buses(n):
pnl = c.pnl pnl = c.pnl
agg = define_clustering(pd.Index(pnl.keys()), aggregate_dict) agg = define_clustering(pd.Index(pnl.keys()), aggregate_dict)
for k in pnl.keys(): for k in pnl.keys():
def renamer(s): def renamer(s):
return s.replace("residential ", "").replace("services ", "") return s.replace("residential ", "").replace("services ", "")

View File

@ -856,7 +856,7 @@ def solve_network(n, config, solving, opts="", **kwargs):
kwargs["assign_all_duals"] = cf_solving.get("assign_all_duals", False) kwargs["assign_all_duals"] = cf_solving.get("assign_all_duals", False)
if kwargs["solver_name"] == "gurobi": 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) rolling_horizon = cf_solving.pop("rolling_horizon", False)
skip_iterations = cf_solving.pop("skip_iterations", False) skip_iterations = cf_solving.pop("skip_iterations", False)