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

AssertionError in rule prepare_sector_network #322

Open
2 tasks done
doneachh opened this issue May 31, 2024 · 5 comments
Open
2 tasks done

AssertionError in rule prepare_sector_network #322

doneachh opened this issue May 31, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@doneachh
Copy link
Collaborator

doneachh commented May 31, 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

AssertionError: Failed to add Carrier component H2 because there is already an object with this name in carriers
Received the same error for Tunisia, Namibia and Ethiopia.

Error Message

Traceback (most recent call last):
  File "/mnt/l/Git/Ethiopia/pypsa-earth-sec/.snakemake/scripts/tmpwukee4ey.prepare_sector_network.py", line 2808, in <module>
    add_hydrogen(n, costs)  # TODO add costs
  File "/mnt/l/Git/Ethiopia/pypsa-earth-sec/.snakemake/scripts/tmpwukee4ey.prepare_sector_network.py", line 237, in add_hydrogen
    n.add("Carrier", "H2")
  File "/home/aca39878/anaconda3/envs/pypsa-earth/lib/python3.10/site-packages/pypsa/components.py", line 849, in add
    assert name not in cls_df.index, (
AssertionError: Failed to add Carrier component H2 because there is already an object with this name in carriers
[Fri May 31 20:09:54 2024]
Error in rule prepare_sector_network:
    jobid: 5
    input: results/test_run/prenetworks/elec_s_10_ec_lc1.0_Co2L_144H_2030_0.071_AB_presec.nc, data/costs_2030.csv, data/hydrogen_salt_cavern_potentials.csv, resources/demand/heat/nodal_energy_heat_totals_AB_s_10_2030.csv, resources/demand/transport_AB_s_10_2030.csv, resources/pattern_profiles/avail_profile_AB_s_10_2030.csv, resources/pattern_profiles/dsm_profile_AB_s_10_2030.csv, resources/demand/nodal_transport_data_AB_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_AB.csv, data/energy_totals_AB_2030.csv, data/airports.csv, data/ports.csv, resources/demand/heat/heat_demand_AB_s_10_2030.csv, resources/demand/heat/ashp_cop_AB_s_10_2030.csv, resources/demand/heat/gshp_cop_AB_s_10_2030.csv, resources/demand/heat/solar_thermal_AB_s_10_2030.csv, resources/demand/heat/district_heat_share_AB_s_10_2030.csv, data/temp_hard_coded/biomass_transport_costs.csv, /mnt/l/Git/Ethiopia/pypsa-earth-sec/pypsa-earth/resources/bus_regions/regions_onshore_elec_s_10.geojson, resources/gas_networks/gas_network_elec_s_10.csv
    output: results/test_run/prenetworks/elec_s_10_ec_lc1.0_Co2L_144H_2030_0.071_AB.nc

RuleException:
CalledProcessError in file /mnt/l/Git/Ethiopia/pypsa-earth-sec/Snakefile, line 202:
Command 'set -euo pipefail;  /home/aca39878/anaconda3/envs/pypsa-earth/bin/python3.10 /mnt/l/Git/Ethiopia/pypsa-earth-sec/.snakemake/scripts/tmpwukee4ey.prepare_sector_network.py' returned non-zero exit status 1.
  File "/mnt/l/Git/Ethiopia/pypsa-earth-sec/Snakefile", line 202, in __rule_prepare_sector_network
  File "/home/aca39878/anaconda3/envs/pypsa-earth/lib/python3.10/concurrent/futures/thread.py", line 58, in run
Shutting down, this might take some time.
Exiting because a job execution failed. Look above for error message
Complete log: pypsa-earth/.snakemake/log/2024-05-31T194215.385865.snakemake.log
@doneachh doneachh added the bug Something isn't working label May 31, 2024
@doneachh
Copy link
Collaborator Author

We get this Error here:
image
Guess the reason for this error is that we already have the carrier H2 as hydrogen storage:
image
Will try modelling it without H2 Storage and give an update afterwards.

@doneachh
Copy link
Collaborator Author

Receiving still the same error even without config["extendable_carries"]["Store"] = []

@davide-f
Copy link
Member

davide-f commented Jun 5, 2024

Hello @doneachh :D
Can you share the config?
It seems to me that it is related exactly to that mentioned comment combined (maybe) to the missing re-execution of the subworkflow with the different setting. Could you check?
To check you may start from a clean repo or simply deleting folders resources, networks and results in the subworkflow

@doneachh
Copy link
Collaborator Author

doneachh commented Jun 6, 2024

Hello @davide-f :)
restarted it with a clean repo - will give an update here as soon as i get an Error / run was successfull :)

@doneachh
Copy link
Collaborator Author

doneachh commented Jun 9, 2024

@davide-f Update: recieved the same error again.

config (is not related to the error in my opinion) like default except:

  • countries: ['ET']

config.pypsa-earth (should be not related to the error in my opinion) like default except:

  • countries: ["ET"]
  • build_natura_raster: true
  • ll: ['1.0']
  • opts: [Co2L1-144H]
  • co2limit: 72.0e+6
  • co2base: 72.0e+6
  • renewable_carriers: [solar, onwind, hydro]
  • Offshore: []

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

No branches or pull requests

2 participants