build_sector.smk: simplify gas infrastructure rules

This commit is contained in:
Fabian Neumann 2024-01-04 19:12:04 +01:00
parent a67c5ea3b7
commit 62bcded800

View File

@ -67,8 +67,6 @@ rule build_simplified_population_layouts:
"../scripts/build_clustered_population_layouts.py"
if config["sector"]["gas_network"] or config["sector"]["H2_retrofit"]:
rule build_gas_network:
input:
gas_network="data/gas_network/scigrid-gas/data/IGGIELGN_PipeSegments.geojson",
@ -83,6 +81,7 @@ if config["sector"]["gas_network"] or config["sector"]["H2_retrofit"]:
script:
"../scripts/build_gas_network.py"
rule build_gas_input_locations:
input:
gem=HTTP.remote(
@ -109,6 +108,7 @@ if config["sector"]["gas_network"] or config["sector"]["H2_retrofit"]:
script:
"../scripts/build_gas_input_locations.py"
rule cluster_gas_network:
input:
cleaned_gas_network=RESOURCES + "gas_network.csv",
@ -127,17 +127,6 @@ if config["sector"]["gas_network"] or config["sector"]["H2_retrofit"]:
script:
"../scripts/cluster_gas_network.py"
gas_infrastructure = {
**rules.cluster_gas_network.output,
**rules.build_gas_input_locations.output,
}
if not (config["sector"]["gas_network"] or config["sector"]["H2_retrofit"]):
# this is effecively an `else` statement which is however not liked by snakefmt
gas_infrastructure = {}
rule build_heat_demands:
params:
@ -722,7 +711,8 @@ rule prepare_sector_network:
input:
**build_retro_cost_output,
**build_biomass_transport_costs_output,
**gas_infrastructure,
**rules.cluster_gas_network.output,
**rules.build_gas_input_locations.output,
**build_sequestration_potentials_output,
network=RESOURCES + "networks/elec_s{simpl}_{clusters}_ec_l{ll}_{opts}.nc",
energy_totals_name=RESOURCES + "energy_totals.csv",