pypsa-meets-earth / pypsa-earth-sec

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

AssertionError in rule prepare_sector_network #322

Open doneachh opened 1 month ago

doneachh commented 1 month ago

Checklist

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 commented 1 month ago

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 commented 1 month ago

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

davide-f commented 3 weeks ago

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 commented 3 weeks ago

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 commented 3 weeks ago

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

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

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