Hi all!
I am currently running solve_sector_networks for Denmark as an island. I am doing some test runs with different clustering and as I higher that number the workflow stops. Attached you can find the error that appears in my terminal. Basically it stops when building the renewable profile for offshore regions. I guess, this is because the rule is feeding the onshore .geojson file where ['DK1 7', 'DK1 8'] is not present (it is in the offshore .geojson file).
Let me know if you can help me out! Thank you in advance!
The error is the following:
INFO:__main__:correction_factor is set as 0.8855
ERROR:root:Uncaught exception
Traceback (most recent call last):
File "/home/gpetr/pypsa-eur-Thesis/.snakemake/scripts/
tmpea12mgpo.build_renewable_profiles.py", line 155, in <module>
regions = regions.loc[offshore_regions]
~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
File "/home/gpetr/miniconda3/envs/pypsa-eur/lib/python3.12/site-packages/pandas/core/indexing.py", line 1191, in __getitem__
return self._getitem_axis(maybe_callable, axis=axis)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/gpetr/miniconda3/envs/pypsa-eur/lib/python3.12/site-packages/pandas/core/indexing.py", line 1420, in _getitem_axis
return self._getitem_iterable(key, axis=axis)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/gpetr/miniconda3/envs/pypsa-eur/lib/python3.12/site-packages/pandas/core/indexing.py", line 1360, in _getitem_iterable
keyarr, indexer = self._get_listlike_indexer(key, axis)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/gpetr/miniconda3/envs/pypsa-eur/lib/python3.12/site-packages/pandas/core/indexing.py", line 1558, in _get_listlike_indexer
keyarr, indexer = ax._get_indexer_strict(key, axis_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/gpetr/miniconda3/envs/pypsa-eur/lib/python3.12/site-packages/pandas/core/indexes/base.py", line 6200, in _get_indexer_strict
self._raise_if_missing(keyarr, indexer, axis_name)
File "/home/gpetr/miniconda3/envs/pypsa-eur/lib/python3.12/site-packages/pandas/core/indexes/base.py", line 6252, in _raise_if_missing
raise KeyError(f"{not_found} not in index")
KeyError: "['DK1 7', 'DK1 8'] not in index"RuleException:
CalledProcessError in file /home/gpetr/pypsa-eur-Thesis/rules/build_electricity.smk, line 336:
Command 'set -euo pipefail; /home/gpetr/miniconda3/envs/pypsa-eur/bin/python3.12 /home/gpetr/pypsa-eur-Thesis/.snakemake/scripts/
tmpea12mgpo.build_renewable_profiles.py' returned non-zero exit status 1.
[Tue Apr 1 13:51:34 2025]
Error in rule build_renewable_profiles: jobid: 4
input: resources/Denmark-20-nodes/
availability_matrix_20_offwind-ac.nc, resources/Denmark-20-nodes/offshore_shapes.geojson,
resources/Denmark-20-nodes/regions_onshore_base_s_20.geojson, cutouts/
europe-2013-sarah3-era5.nc output: resources/Denmark-20-nodes/
profile_20_offwind-ac.nc log: logs/Denmark-20-nodes/build_renewable_profile_20_offwind-ac.log (check log file(s) for error details)
conda-env: /home/gpetr/pypsa-eur-Thesis/.snakemake/conda/62cb76f7c03aad609dda6a4c1d3ac45c_
Shutting down, this might take some time.
Exiting because a job execution failed. Look above for error message
Complete log: .snakemake/log/2025-04-01T131855.140953.snakemake.log
WorkflowError:
At least one job did not complete successfully.