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,7 +295,9 @@ 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"]:
rule build_biomass_transport_costs:
input: input:
transport_cost_data=HTTP.remote( transport_cost_data=HTTP.remote(
"publications.jrc.ec.europa.eu/repository/bitstream/JRC98626/biomass potentials in europe_web rev.pdf", "publications.jrc.ec.europa.eu/repository/bitstream/JRC98626/biomass potentials in europe_web rev.pdf",
@ -315,6 +317,13 @@ rule build_biomass_transport_costs:
script: script:
"../scripts/build_biomass_transport_costs.py" "../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",