Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
2 tasks
doneachh opened this issue Feb 1, 2024 · 0 comments · Fixed by #276
Closed
2 tasks

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

doneachh opened this issue Feb 1, 2024 · 0 comments · Fixed by #276
Labels
bug Something isn't working

Comments

@doneachh
Copy link
Collaborator

doneachh commented Feb 1, 2024

Checklist

  • I am using the current main branch or the latest release. Please indicate.
  • I am running on an up-to-date pypsa-africa environment. Update via conda env update -f envs/environment.yaml.

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```
@doneachh doneachh added the bug Something isn't working label Feb 1, 2024
@doneachh doneachh linked a pull request Feb 1, 2024 that will close this issue
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant