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

View File

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

View File

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

View File

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