[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-02-05 18:23:48 +00:00
parent 0553108e3d
commit 39890630ef
5 changed files with 73 additions and 54 deletions

View File

@ -401,18 +401,22 @@ rule add_electricity:
if str(fn).startswith("data/") if str(fn).startswith("data/")
}, },
base_network=RESOURCES + "networks/base.nc", base_network=RESOURCES + "networks/base.nc",
line_rating=RESOURCES + "networks/line_rating.nc" line_rating=(
RESOURCES + "networks/line_rating.nc"
if config["lines"]["dynamic_line_rating"]["activate"] if config["lines"]["dynamic_line_rating"]["activate"]
else RESOURCES + "networks/base.nc", else RESOURCES + "networks/base.nc"
),
tech_costs=COSTS, tech_costs=COSTS,
regions=RESOURCES + "regions_onshore.geojson", regions=RESOURCES + "regions_onshore.geojson",
powerplants=RESOURCES + "powerplants.csv", powerplants=RESOURCES + "powerplants.csv",
hydro_capacities=ancient("data/bundle/hydro_capacities.csv"), hydro_capacities=ancient("data/bundle/hydro_capacities.csv"),
geth_hydro_capacities="data/geth2015_hydro_capacities.csv", geth_hydro_capacities="data/geth2015_hydro_capacities.csv",
unit_commitment="data/unit_commitment.csv", unit_commitment="data/unit_commitment.csv",
fuel_price=RESOURCES + "monthly_fuel_price.csv" fuel_price=(
RESOURCES + "monthly_fuel_price.csv"
if config["conventional"]["dynamic_fuel_price"] if config["conventional"]["dynamic_fuel_price"]
else [], else []
),
load=RESOURCES + "load.csv", load=RESOURCES + "load.csv",
nuts3_shapes=RESOURCES + "nuts3_shapes.geojson", nuts3_shapes=RESOURCES + "nuts3_shapes.geojson",
ua_md_gdp="data/GDP_PPP_30arcsec_v3_mapped_default.csv", ua_md_gdp="data/GDP_PPP_30arcsec_v3_mapped_default.csv",

View File

@ -797,15 +797,19 @@ rule prepare_sector_network:
dsm_profile=RESOURCES + "dsm_profile_s{simpl}_{clusters}.csv", dsm_profile=RESOURCES + "dsm_profile_s{simpl}_{clusters}.csv",
co2_totals_name=RESOURCES + "co2_totals.csv", co2_totals_name=RESOURCES + "co2_totals.csv",
co2="data/bundle-sector/eea/UNFCCC_v23.csv", co2="data/bundle-sector/eea/UNFCCC_v23.csv",
biomass_potentials=RESOURCES biomass_potentials=(
RESOURCES
+ "biomass_potentials_s{simpl}_{clusters}_" + "biomass_potentials_s{simpl}_{clusters}_"
+ "{}.csv".format(config["biomass"]["year"]) + "{}.csv".format(config["biomass"]["year"])
if config["foresight"] == "overnight" if config["foresight"] == "overnight"
else RESOURCES else RESOURCES
+ "biomass_potentials_s{simpl}_{clusters}_{planning_horizons}.csv", + "biomass_potentials_s{simpl}_{clusters}_{planning_horizons}.csv"
costs="data/costs_{}.csv".format(config["costs"]["year"]) ),
costs=(
"data/costs_{}.csv".format(config["costs"]["year"])
if config["foresight"] == "overnight" if config["foresight"] == "overnight"
else "data/costs_{planning_horizons}.csv", else "data/costs_{planning_horizons}.csv"
),
profile_offwind_ac=RESOURCES + "profile_offwind-ac.nc", profile_offwind_ac=RESOURCES + "profile_offwind-ac.nc",
profile_offwind_dc=RESOURCES + "profile_offwind-dc.nc", profile_offwind_dc=RESOURCES + "profile_offwind-dc.nc",
h2_cavern=RESOURCES + "salt_cavern_potentials_s{simpl}_{clusters}.csv", h2_cavern=RESOURCES + "salt_cavern_potentials_s{simpl}_{clusters}.csv",
@ -831,18 +835,21 @@ rule prepare_sector_network:
cop_air_total=RESOURCES + "cop_air_total_elec_s{simpl}_{clusters}.nc", cop_air_total=RESOURCES + "cop_air_total_elec_s{simpl}_{clusters}.nc",
cop_air_rural=RESOURCES + "cop_air_rural_elec_s{simpl}_{clusters}.nc", cop_air_rural=RESOURCES + "cop_air_rural_elec_s{simpl}_{clusters}.nc",
cop_air_urban=RESOURCES + "cop_air_urban_elec_s{simpl}_{clusters}.nc", cop_air_urban=RESOURCES + "cop_air_urban_elec_s{simpl}_{clusters}.nc",
solar_thermal_total=RESOURCES solar_thermal_total=(
+ "solar_thermal_total_elec_s{simpl}_{clusters}.nc" RESOURCES + "solar_thermal_total_elec_s{simpl}_{clusters}.nc"
if config["sector"]["solar_thermal"] if config["sector"]["solar_thermal"]
else [], else []
solar_thermal_urban=RESOURCES ),
+ "solar_thermal_urban_elec_s{simpl}_{clusters}.nc" solar_thermal_urban=(
RESOURCES + "solar_thermal_urban_elec_s{simpl}_{clusters}.nc"
if config["sector"]["solar_thermal"] if config["sector"]["solar_thermal"]
else [], else []
solar_thermal_rural=RESOURCES ),
+ "solar_thermal_rural_elec_s{simpl}_{clusters}.nc" solar_thermal_rural=(
RESOURCES + "solar_thermal_rural_elec_s{simpl}_{clusters}.nc"
if config["sector"]["solar_thermal"] if config["sector"]["solar_thermal"]
else [], else []
),
output: output:
RESULTS RESULTS
+ "prenetworks/elec_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}.nc", + "prenetworks/elec_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}.nc",

View File

@ -29,7 +29,7 @@ rule prepare_elec_networks:
input: input:
expand( 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"] **config["scenario"],
), ),
@ -38,7 +38,7 @@ rule prepare_sector_networks:
expand( expand(
RESULTS RESULTS
+ "prenetworks/elec_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}.nc", + "prenetworks/elec_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}.nc",
**config["scenario"] **config["scenario"],
), ),
@ -46,7 +46,7 @@ rule solve_elec_networks:
input: input:
expand( 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"] **config["scenario"],
), ),
@ -55,7 +55,7 @@ rule solve_sector_networks:
expand( expand(
RESULTS RESULTS
+ "postnetworks/elec_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}.nc", + "postnetworks/elec_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}.nc",
**config["scenario"] **config["scenario"],
), ),
@ -64,7 +64,7 @@ rule solve_sector_networks_perfect:
expand( expand(
RESULTS RESULTS
+ "postnetworks/elec_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}_brownfield_all_years.nc", + "postnetworks/elec_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}_brownfield_all_years.nc",
**config["scenario"] **config["scenario"],
), ),
@ -73,11 +73,11 @@ rule validate_elec_networks:
expand( expand(
RESULTS RESULTS
+ "figures/.statistics_plots_elec_s{simpl}_{clusters}_ec_l{ll}_{opts}", + "figures/.statistics_plots_elec_s{simpl}_{clusters}_ec_l{ll}_{opts}",
**config["scenario"] **config["scenario"],
), ),
expand( expand(
RESULTS RESULTS
+ "figures/.validation_{kind}_plots_elec_s{simpl}_{clusters}_ec_l{ll}_{opts}", + "figures/.validation_{kind}_plots_elec_s{simpl}_{clusters}_ec_l{ll}_{opts}",
**config["scenario"], **config["scenario"],
kind=["production", "prices", "cross_border"] kind=["production", "prices", "cross_border"],
), ),

View File

@ -153,38 +153,44 @@ rule make_summary:
input: input:
expand( expand(
RESULTS + "maps/power-network-s{simpl}-{clusters}.pdf", RESULTS + "maps/power-network-s{simpl}-{clusters}.pdf",
**config["scenario"] **config["scenario"],
), ),
networks=expand( networks=expand(
RESULTS RESULTS
+ "postnetworks/elec_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}.nc", + "postnetworks/elec_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}.nc",
**config["scenario"] **config["scenario"],
), ),
costs="data/costs_{}.csv".format(config["costs"]["year"]) costs=(
"data/costs_{}.csv".format(config["costs"]["year"])
if config["foresight"] == "overnight" if config["foresight"] == "overnight"
else "data/costs_{}.csv".format(config["scenario"]["planning_horizons"][0]), else "data/costs_{}.csv".format(config["scenario"]["planning_horizons"][0])
),
ac_plot=expand( ac_plot=expand(
RESULTS + "maps/power-network-s{simpl}-{clusters}.pdf", RESULTS + "maps/power-network-s{simpl}-{clusters}.pdf",
**config["scenario"] **config["scenario"],
), ),
costs_plot=expand( costs_plot=expand(
RESULTS RESULTS
+ "maps/elec_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}-costs-all_{planning_horizons}.pdf", + "maps/elec_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}-costs-all_{planning_horizons}.pdf",
**config["scenario"] **config["scenario"],
), ),
h2_plot=expand( h2_plot=expand(
(
RESULTS RESULTS
+ "maps/elec_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}-h2_network_{planning_horizons}.pdf" + "maps/elec_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}-h2_network_{planning_horizons}.pdf"
if config["sector"]["H2_network"] if config["sector"]["H2_network"]
else [], else []
**config["scenario"] ),
**config["scenario"],
), ),
ch4_plot=expand( ch4_plot=expand(
(
RESULTS RESULTS
+ "maps/elec_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}-ch4_network_{planning_horizons}.pdf" + "maps/elec_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}-ch4_network_{planning_horizons}.pdf"
if config["sector"]["gas_network"] if config["sector"]["gas_network"]
else [], else []
**config["scenario"] ),
**config["scenario"],
), ),
output: output:
nodal_costs=RESULTS + "csvs/nodal_costs.csv", nodal_costs=RESULTS + "csvs/nodal_costs.csv",

View File

@ -191,9 +191,11 @@ if config["enable"]["retrieve"]:
input: input:
HTTP.remote( HTTP.remote(
"data.open-power-system-data.org/time_series/{version}/time_series_60min_singleindex.csv".format( "data.open-power-system-data.org/time_series/{version}/time_series_60min_singleindex.csv".format(
version="2019-06-05" version=(
"2019-06-05"
if config["snapshots"]["end"] < "2019" if config["snapshots"]["end"] < "2019"
else "2020-10-06" else "2020-10-06"
)
), ),
keep_local=True, keep_local=True,
static=True, static=True,