prepare_sectors: make biomass transport costs conditional again

This commit is contained in:
Fabian 2023-08-02 14:02:25 +02:00
parent b2ab4bbe56
commit f205ff9536

View File

@ -295,25 +295,34 @@ rule build_biomass_potentials:
"../scripts/build_biomass_potentials.py" "../scripts/build_biomass_potentials.py"
rule build_biomass_transport_costs: if config["sector"]["biomass_transport"] or config["sector"]["biomass_spatial"]:
input:
transport_cost_data=HTTP.remote( rule build_biomass_transport_costs:
"publications.jrc.ec.europa.eu/repository/bitstream/JRC98626/biomass potentials in europe_web rev.pdf", input:
keep_local=True, transport_cost_data=HTTP.remote(
), "publications.jrc.ec.europa.eu/repository/bitstream/JRC98626/biomass potentials in europe_web rev.pdf",
output: keep_local=True,
biomass_transport_costs=RESOURCES + "biomass_transport_costs.csv", ),
threads: 1 output:
resources: biomass_transport_costs=RESOURCES + "biomass_transport_costs.csv",
mem_mb=1000, threads: 1
log: resources:
LOGS + "build_biomass_transport_costs.log", mem_mb=1000,
benchmark: log:
BENCHMARKS + "build_biomass_transport_costs" LOGS + "build_biomass_transport_costs.log",
conda: benchmark:
"../envs/environment.yaml" BENCHMARKS + "build_biomass_transport_costs"
script: conda:
"../scripts/build_biomass_transport_costs.py" "../envs/environment.yaml"
script:
"../scripts/build_biomass_transport_costs.py"
build_biomass_transport_costs_output = rules.build_biomass_transport_costs.output
if not (config["sector"]["biomass_transport"] or config["sector"]["biomass_spatial"]):
# this is effecively an `else` statement which is however not liked by snakefmt
build_biomass_transport_costs_output = {}
if config["sector"]["regional_co2_sequestration_potential"]["enable"]: if config["sector"]["regional_co2_sequestration_potential"]["enable"]:
@ -711,7 +720,7 @@ rule prepare_sector_network:
RDIR=RDIR, RDIR=RDIR,
input: input:
**build_retro_cost_output, **build_retro_cost_output,
**rules.build_biomass_transport_costs.output, **build_biomass_transport_costs_output,
**gas_infrastructure, **gas_infrastructure,
**build_sequestration_potentials_output, **build_sequestration_potentials_output,
network=RESOURCES + "networks/elec_s{simpl}_{clusters}_ec_l{ll}_{opts}.nc", network=RESOURCES + "networks/elec_s{simpl}_{clusters}_ec_l{ll}_{opts}.nc",
@ -772,7 +781,7 @@ rule prepare_sector_network:
+ "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",
threads: 1 threads: 1
resources: resources:
mem_mb=20000, mem_mb=2000,
log: log:
LOGS LOGS
+ "prepare_sector_network_elec_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}.log", + "prepare_sector_network_elec_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}.log",