pypsa-meets-earth / pypsa-earth-sec

GNU General Public License v3.0
19 stars 16 forks source link

KeyError 'Co2L' when modelling with config.default #274

Closed doneachh closed 5 months ago

doneachh commented 5 months ago

Checklist

Describe the Bug

config.default has dynamic_transport (enable: true) and opts: "Co2L" --> KeyError "Co2L" in prepare_sector_network when using default config

Error Message


Traceback (most recent call last):
  File "/mnt/c/Users/aca39878/Documents/Git/Namibia/pypsa-earth-sec/.snakemake/scripts/tmpk7ejeml8.prepare_sector_network.py", line 2468, in <module>
    add_land_transport(n, costs)
  File "/mnt/c/Users/aca39878/Documents/Git/Namibia/pypsa-earth-sec/.snakemake/scripts/tmpk7ejeml8.prepare_sector_network.py", line 1414, in add_land_transport
    fuel_cell_share = options["dynamic_transport"][
KeyError: 'Co2L'
[Thu Feb  1 12:23:39 2024]
INFO:snakemake.logging:[Thu Feb  1 12:23:39 2024]
Error in rule prepare_sector_network:
    jobid: 5
    input: results/test_h2_cons_yearly/prenetworks/elec_s_10_ec_lc1.0_Co2L_144H_2030_0.15_DF_presec.nc, data/costs_2030.csv, data/hydrogen_salt_cavern_potentials.csv, resources/demand/heat/nodal_energy_heat_totals_DF_s_10_2030.csv, resources/demand/transport_DF_s_10_2030.csv, resources/pattern_profiles/avail_profile_DF_s_10_2030.csv, resources/pattern_profiles/dsm_profile_DF_s_10_2030.csv, resources/demand/nodal_transport_data_DF_s_10_2030.csv, data/override_component_attrs, resources/population_shares/pop_layout_elec_s_10.csv, resources/demand/industrial_energy_demand_per_node_elec_s_10_2030_DF.csv, data/energy_totals_DF_2030.csv, data/airports.csv, data/ports.csv, resources/demand/heat/heat_demand_DF_s_10_2030.csv, resources/demand/heat/ashp_cop_DF_s_10_2030.csv, resources/demand/heat/gshp_cop_DF_s_10_2030.csv, resources/demand/heat/solar_thermal_DF_s_10_2030.csv, resources/demand/heat/district_heat_share_DF_s_10_2030.csv, data/temp_hard_coded/biomass_transport_costs.csv, /mnt/c/Users/aca39878/Documents/Git/Namibia/pypsa-earth-sec/pypsa-earth/resources/bus_regions/regions_onshore_elec_s_10.geojson
    output: results/test_h2_cons_yearly/prenetworks/elec_s_10_ec_lc1.0_Co2L_144H_2030_0.15_DF.nc

ERROR:snakemake.logging:Error in rule prepare_sector_network:
    jobid: 5
    input: results/test_h2_cons_yearly/prenetworks/elec_s_10_ec_lc1.0_Co2L_144H_2030_0.15_DF_presec.nc, data/costs_2030.csv, data/hydrogen_salt_cavern_potentials.csv, resources/demand/heat/nodal_energy_heat_totals_DF_s_10_2030.csv, resources/demand/transport_DF_s_10_2030.csv, resources/pattern_profiles/avail_profile_DF_s_10_2030.csv, resources/pattern_profiles/dsm_profile_DF_s_10_2030.csv, resources/demand/nodal_transport_data_DF_s_10_2030.csv, data/override_component_attrs, resources/population_shares/pop_layout_elec_s_10.csv, resources/demand/industrial_energy_demand_per_node_elec_s_10_2030_DF.csv, data/energy_totals_DF_2030.csv, data/airports.csv, data/ports.csv, resources/demand/heat/heat_demand_DF_s_10_2030.csv, resources/demand/heat/ashp_cop_DF_s_10_2030.csv, resources/demand/heat/gshp_cop_DF_s_10_2030.csv, resources/demand/heat/solar_thermal_DF_s_10_2030.csv, resources/demand/heat/district_heat_share_DF_s_10_2030.csv, data/temp_hard_coded/biomass_transport_costs.csv, /mnt/c/Users/aca39878/Documents/Git/Namibia/pypsa-earth-sec/pypsa-earth/resources/bus_regions/regions_onshore_elec_s_10.geojson
    output: results/test_h2_cons_yearly/prenetworks/elec_s_10_ec_lc1.0_Co2L_144H_2030_0.15_DF.nc

RuleException:
CalledProcessError in file /mnt/c/Users/aca39878/Documents/Git/Namibia/pypsa-earth-sec/Snakefile, line 156:
Command 'set -euo pipefail;  /home/aca39878/anaconda3/envs/pypsa-earth/bin/python3.10 /mnt/c/Users/aca39878/Documents/Git/Namibia/pypsa-earth-sec/.snakemake/scripts/tmpk7ejeml8.prepare_sector_network.py' returned non-zero exit status 1.
  File "/mnt/c/Users/aca39878/Documents/Git/Namibia/pypsa-earth-sec/Snakefile", line 156, in __rule_prepare_sector_network
  File "/home/aca39878/anaconda3/envs/pypsa-earth/lib/python3.10/concurrent/futures/thread.py", line 58, in run
ERROR:snakemake.logging:RuleException:
CalledProcessError in file /mnt/c/Users/aca39878/Documents/Git/Namibia/pypsa-earth-sec/Snakefile, line 156:
Command 'set -euo pipefail;  /home/aca39878/anaconda3/envs/pypsa-earth/bin/python3.10 /mnt/c/Users/aca39878/Documents/Git/Namibia/pypsa-earth-sec/.snakemake/scripts/tmpk7ejeml8.prepare_sector_network.py' returned non-zero exit status 1.
  File "/mnt/c/Users/aca39878/Documents/Git/Namibia/pypsa-earth-sec/Snakefile", line 156, in __rule_prepare_sector_network
  File "/home/aca39878/anaconda3/envs/pypsa-earth/lib/python3.10/concurrent/futures/thread.py", line 58, in run```