Skip to content

clusters=all does not work with default config #2192

Description

@hd1ex

Version Checks (indicate both or one)

  • I have confirmed this bug exists on the lastest release of PyPSA-Eur.

  • I have confirmed this bug exists on the current master branch of PyPSA-Eur.

Issue Description

Thank you for providing and maintaining this awesome model!

My goal is to get an unclustered version of the full network to create something like the base map linked in the README but interactive like the transport map from @bobbyxng and with power plants like Open Infrastructure Map.

Production and demand is added after clustering, so the documentation for the scenario config promotes an option to set the clusters to all.

Sadly, the model fails to run with this option and the default config: 2026-06-09T123634.430829.snakemake.log

The following error seems to let the run fail:

INFO:__main__:Using biomass potentials for 2030.
ERROR:root:Uncaught exception
Traceback (most recent call last):
  File "/home/alex/test/pypsa-eur/.snakemake/scripts/tmpjh1ih7wi.build_shipping_demand.py", line 59, in <module>
    nodal_demand = demand.loc[countries].fillna(0.0)
                   ~~~~~~~~~~^^^^^^^^^^^
  File "/home/alex/test/pypsa-eur/.pixi/envs/default/lib/python3.12/site-packages/pandas/core/indexing.py", line 1192, in __getitem__
    return self._getitem_axis(maybe_callable, axis=axis)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/alex/test/pypsa-eur/.pixi/envs/default/lib/python3.12/site-packages/pandas/core/indexing.py", line 1421, in _getitem_axis
    return self._getitem_iterable(key, axis=axis)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/alex/test/pypsa-eur/.pixi/envs/default/lib/python3.12/site-packages/pandas/core/indexing.py", line 1361, in _getitem_iterable
    keyarr, indexer = self._get_listlike_indexer(key, axis)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/alex/test/pypsa-eur/.pixi/envs/default/lib/python3.12/site-packages/pandas/core/indexing.py", line 1559, in _get_listlike_indexer
    keyarr, indexer = ax._get_indexer_strict(key, axis_name)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/alex/test/pypsa-eur/.pixi/envs/default/lib/python3.12/site-packages/pandas/core/indexes/base.py", line 6212, in _get_indexer_strict
    self._raise_if_missing(keyarr, indexer, axis_name)
  File "/home/alex/test/pypsa-eur/.pixi/envs/default/lib/python3.12/site-packages/pandas/core/indexes/base.py", line 6261, in _raise_if_missing
    raise KeyError(f"None of [{key}] are in the [{axis_name}]")
KeyError: "None of [Index(['re', 're', 're', 're', 're', 're', 're', 're', 're', 're',\n       ...\n       'wa', 'wa', 'wa', 'wa', 'wa', 'wa', 'wa', 'wa', 'wa', 'wa'],\n      dtype='object', name='name', length=194)] are in the [index]"

Am I missing configuring something or is this indeed a bug?

Reproducible Example

git clone https://github.com/PyPSA/pypsa-eur
cd pypsa-eur
pixi shell
echo 'scenario:   
  clusters:
  - all
' > config/config.yaml
snakemake -call --until prepare_sector_network

Expected Behavior

Get the full PyPSA-Eur base sector network in resources/networks/base_s_all.nc (generators, storage, demand, lines, links etc.) without any or minimal clustering.

Installed Versions

pixi.lock

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Fields

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions