[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-03-04 17:26:39 +00:00
parent 92922728d8
commit f4f4c1bf37
4 changed files with 14 additions and 39 deletions

View File

@ -496,9 +496,7 @@ rule simplify_network:
output: output:
network=resources("networks/elec_s{simpl}.nc"), network=resources("networks/elec_s{simpl}.nc"),
regions_onshore=resources("regions_onshore_elec_s{simpl}.geojson"), regions_onshore=resources("regions_onshore_elec_s{simpl}.geojson"),
regions_offshore=resources( regions_offshore=resources("regions_offshore_elec_s{simpl}.geojson"),
"regions_offshore_elec_s{simpl}.geojson"
),
busmap=resources("busmap_elec_s{simpl}.csv"), busmap=resources("busmap_elec_s{simpl}.csv"),
connection_costs=resources("connection_costs_s{simpl}.csv"), connection_costs=resources("connection_costs_s{simpl}.csv"),
log: log:
@ -532,9 +530,7 @@ rule cluster_network:
input: input:
network=resources("networks/elec_s{simpl}.nc"), network=resources("networks/elec_s{simpl}.nc"),
regions_onshore=resources("regions_onshore_elec_s{simpl}.geojson"), regions_onshore=resources("regions_onshore_elec_s{simpl}.geojson"),
regions_offshore=resources( regions_offshore=resources("regions_offshore_elec_s{simpl}.geojson"),
"regions_offshore_elec_s{simpl}.geojson"
),
busmap=ancient(resources("busmap_elec_s{simpl}.csv")), busmap=ancient(resources("busmap_elec_s{simpl}.csv")),
custom_busmap=lambda w: ( custom_busmap=lambda w: (
"data/custom_busmap_elec_s{simpl}_{clusters}.csv" "data/custom_busmap_elec_s{simpl}_{clusters}.csv"
@ -546,12 +542,8 @@ rule cluster_network:
), ),
output: output:
network=resources("networks/elec_s{simpl}_{clusters}.nc"), network=resources("networks/elec_s{simpl}_{clusters}.nc"),
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"
),
busmap=resources("busmap_elec_s{simpl}_{clusters}.csv"), busmap=resources("busmap_elec_s{simpl}_{clusters}.csv"),
linemap=resources("linemap_elec_s{simpl}_{clusters}.csv"), linemap=resources("linemap_elec_s{simpl}_{clusters}.csv"),
log: log:
@ -615,15 +607,9 @@ rule prepare_network:
output: output:
resources("networks/elec_s{simpl}_{clusters}_ec_l{ll}_{opts}.nc"), resources("networks/elec_s{simpl}_{clusters}_ec_l{ll}_{opts}.nc"),
log: log:
logs( logs("prepare_network/elec_s{simpl}_{clusters}_ec_l{ll}_{opts}.log"),
"prepare_network/elec_s{simpl}_{clusters}_ec_l{ll}_{opts}.log"
),
benchmark: benchmark:
( (benchmarks("prepare_network/elec_s{simpl}_{clusters}_ec_l{ll}_{opts}"))
benchmarks(
"prepare_network/elec_s{simpl}_{clusters}_ec_l{ll}_{opts}"
)
)
threads: 1 threads: 1
resources: resources:
mem_mb=4000, mem_mb=4000,

View File

@ -34,9 +34,7 @@ rule extra_components_networks:
rule prepare_elec_networks: rule prepare_elec_networks:
input: input:
expand( expand(
resources( resources("networks/elec_s{simpl}_{clusters}_ec_l{ll}_{opts}.nc"),
"networks/elec_s{simpl}_{clusters}_ec_l{ll}_{opts}.nc"
),
**config["scenario"], **config["scenario"],
run=config["run"]["name"], run=config["run"]["name"],
), ),
@ -55,8 +53,7 @@ rule prepare_sector_networks:
rule solve_elec_networks: rule solve_elec_networks:
input: input:
expand( expand(
RESULTS RESULTS + "networks/elec_s{simpl}_{clusters}_ec_l{ll}_{opts}.nc",
+ "networks/elec_s{simpl}_{clusters}_ec_l{ll}_{opts}.nc",
**config["scenario"], **config["scenario"],
run=config["run"]["name"], run=config["run"]["name"],
), ),

View File

@ -13,13 +13,10 @@ rule solve_network:
), ),
custom_extra_functionality=input_custom_extra_functionality, custom_extra_functionality=input_custom_extra_functionality,
input: input:
network=resources( network=resources("networks/elec_s{simpl}_{clusters}_ec_l{ll}_{opts}.nc"),
"networks/elec_s{simpl}_{clusters}_ec_l{ll}_{opts}.nc"
),
config=RESULTS + "config.yaml", config=RESULTS + "config.yaml",
output: output:
network=RESULTS network=RESULTS + "networks/elec_s{simpl}_{clusters}_ec_l{ll}_{opts}.nc",
+ "networks/elec_s{simpl}_{clusters}_ec_l{ll}_{opts}.nc",
log: log:
solver=normpath( solver=normpath(
RESULTS RESULTS
@ -28,10 +25,7 @@ rule solve_network:
python=RESULTS python=RESULTS
+ "logs/solve_network/elec_s{simpl}_{clusters}_ec_l{ll}_{opts}_python.log", + "logs/solve_network/elec_s{simpl}_{clusters}_ec_l{ll}_{opts}_python.log",
benchmark: benchmark:
( (RESULTS + "benchmarks/solve_network/elec_s{simpl}_{clusters}_ec_l{ll}_{opts}")
RESULTS
+ "benchmarks/solve_network/elec_s{simpl}_{clusters}_ec_l{ll}_{opts}"
)
threads: solver_threads threads: solver_threads
resources: resources:
mem_mb=memory, mem_mb=memory,
@ -48,11 +42,9 @@ rule solve_operations_network:
params: params:
options=config_provider("solving", "options"), options=config_provider("solving", "options"),
input: input:
network=RESULTS network=RESULTS + "networks/elec_s{simpl}_{clusters}_ec_l{ll}_{opts}.nc",
+ "networks/elec_s{simpl}_{clusters}_ec_l{ll}_{opts}.nc",
output: output:
network=RESULTS network=RESULTS + "networks/elec_s{simpl}_{clusters}_ec_l{ll}_{opts}_op.nc",
+ "networks/elec_s{simpl}_{clusters}_ec_l{ll}_{opts}_op.nc",
log: log:
solver=normpath( solver=normpath(
RESULTS RESULTS

View File

@ -65,8 +65,8 @@ import atlite
import country_converter as coco import country_converter as coco
import geopandas as gpd import geopandas as gpd
import pandas as pd import pandas as pd
from numpy.polynomial import Polynomial
from _helpers import configure_logging, set_scenario_config from _helpers import configure_logging, set_scenario_config
from numpy.polynomial import Polynomial
cc = coco.CountryConverter() cc = coco.CountryConverter()