From b8d57a6566c410e871fe4ca97096e75dc060fb0e Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sat, 17 Feb 2024 16:39:10 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- Snakefile | 1 - rules/solve_myopic.smk | 8 +++++--- rules/solve_perfect.smk | 10 ++++++---- scripts/prepare_network.py | 6 +++++- 4 files changed, 16 insertions(+), 9 deletions(-) diff --git a/Snakefile b/Snakefile index 2c342efc..a59025f9 100644 --- a/Snakefile +++ b/Snakefile @@ -47,7 +47,6 @@ RESULTS = "results/" + RDIR # RESOURCES = "resources/" - localrules: purge, diff --git a/rules/solve_myopic.smk b/rules/solve_myopic.smk index 03cbb705..8574bbb8 100644 --- a/rules/solve_myopic.smk +++ b/rules/solve_myopic.smk @@ -16,9 +16,11 @@ rule add_existing_baseyear: busmap_s=resources("busmap_elec_s{simpl}.csv"), busmap=resources("busmap_elec_s{simpl}_{clusters}.csv"), clustered_pop_layout=resources("pop_layout_elec_s{simpl}_{clusters}.csv"), - costs=lambda w: resources("costs_{}.csv".format( - config_provider("scenario", "planning_horizons", 0)(w) - )), + costs=lambda w: resources( + "costs_{}.csv".format( + config_provider("scenario", "planning_horizons", 0)(w) + ) + ), cop_soil_total=resources("cop_soil_total_elec_s{simpl}_{clusters}.nc"), cop_air_total=resources("cop_air_total_elec_s{simpl}_{clusters}.nc"), existing_heating_distribution=resources( diff --git a/rules/solve_perfect.smk b/rules/solve_perfect.smk index 723fd6a7..bba71b4d 100644 --- a/rules/solve_perfect.smk +++ b/rules/solve_perfect.smk @@ -14,9 +14,9 @@ rule add_existing_baseyear: busmap_s=resources("busmap_elec_s{simpl}.csv"), busmap=resources("busmap_elec_s{simpl}_{clusters}.csv"), clustered_pop_layout=resources("pop_layout_elec_s{simpl}_{clusters}.csv"), - costs=resources("costs_{}.csv".format( - config_provider("scenario", "planning_horizons", 0) - )), + costs=resources( + "costs_{}.csv".format(config_provider("scenario", "planning_horizons", 0)) + ), cop_soil_total=resources("cop_soil_total_elec_s{simpl}_{clusters}.nc"), cop_air_total=resources("cop_air_total_elec_s{simpl}_{clusters}.nc"), existing_heating_distribution=resources( @@ -65,7 +65,9 @@ rule prepare_perfect_foresight: RESULTS + "prenetworks-brownfield/" + "elec_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}_" - + "{}.nc".format(str(config_provider("scenario", "planning_horizons", 0)(w))) + + "{}.nc".format( + str(config_provider("scenario", "planning_horizons", 0)(w)) + ) ), output: RESULTS diff --git a/scripts/prepare_network.py b/scripts/prepare_network.py index e1b42243..6b782d44 100755 --- a/scripts/prepare_network.py +++ b/scripts/prepare_network.py @@ -62,7 +62,11 @@ import logging import numpy as np import pandas as pd import pypsa -from _helpers import configure_logging, update_config_from_wildcards, set_scenario_config +from _helpers import ( + configure_logging, + set_scenario_config, + update_config_from_wildcards, +) from add_electricity import load_costs, update_transmission_costs from pypsa.descriptors import expand_series