0

Followed basic steps to setup PyPSA-Eur. Electricity only test was successful by executing

snakemake -call results/test-elec/networks/elec_s_6_ec_lcopt_Co2L-24H.nc --configfile config/test/config.electricity.yaml

but when I execute

snakemake -call solve_elec_networks

I get the following error

AssertionError: In Line cluster underground, the values of attribute underground do not agree:

I am using default config and cbc for solving the network. Do I have to make any changes in config.yaml before executing solve_elec_networks rule?

EDIT:

Traceback (most recent call last): File "/mnt/d/inc/pypsa_test/pypsa-eur/.snakemake/scripts/tmplkaoyzq0.cluster_network.py", line 515, in clustering = clustering_for_n_clusters( File "/mnt/d/inc/pypsa_test/pypsa-eur/.snakemake/scripts/tmplkaoyzq0.cluster_network.py", line 413, in clustering_for_n_clusters clustering = get_clustering_from_busmap( File "/home/john/anaconda3/envs/pypsa-eur/lib/python3.10/site-packages/pypsa/clustering/spatial.py", line 535, in get_clustering_from_busmap lines, lines_t, linemap = aggregatelines( File "/home/john/anaconda3/envs/pypsa-eur/lib/python3.10/site-packages/pypsa/clustering/spatial.py", line 436, in aggregatelines df = df.groupby(grouper, axis=0).agg(static_strategies) File "/home/john/.local/lib/python3.10/site-packages/pandas/core/groupby/generic.py", line 1269, in aggregate result = op.agg() File "/home/john/.local/lib/python3.10/site-packages/pandas/core/apply.py", line 163, in agg return self.agg_dict_like() File "/home/john/.local/lib/python3.10/site-packages/pandas/core/apply.py", line 420, in agg_dict_like results = { File "/home/john/.local/lib/python3.10/site-packages/pandas/core/apply.py", line 421, in key: obj._gotitem(key, ndim=1).agg(how) for key, how in arg.items() File "/home/john/.local/lib/python3.10/site-packages/pandas/core/groupby/generic.py", line 269, in aggregate return self._python_agg_general(func, *args, **kwargs) File "/home/john/.local/lib/python3.10/site-packages/pandas/core/groupby/generic.py", line 288, in _python_agg_general result = self.grouper.agg_series(obj, f) File "/home/john/.local/lib/python3.10/site-packages/pandas/core/groupby/ops.py", line 994, in agg_series result = self._aggregate_series_pure_python(obj, func) File "/home/john/.local/lib/python3.10/site-packages/pandas/core/groupby/ops.py", line 1015, in _aggregate_series_pure_python res = func(group) File "/home/john/.local/lib/python3.10/site-packages/pandas/core/groupby/generic.py", line 285, in f = lambda x: func(x, *args, **kwargs) File "/home/john/anaconda3/envs/pypsa-eur/lib/python3.10/site-packages/pypsa/clustering/spatial.py", line 136, in consense assert (x == v).all() or x.isnull().all(), ( AssertionError: In Line cluster underground, the values of attribute underground do not agree:

Line
1380     False
4002     False
5055     False
11429    False
9397     False
5795      True
5733     False
1376     False
Name: underground, dtype: bool
Dakait
  • 2,531
  • 1
  • 25
  • 43
  • In principle it should work. Note that if you call `snakemake -call solve_elec_networks` without specifying `--configfile` you will use the `configfile: config/config.yaml` or if that file does not exist the file `config/config.default.yaml`. So it might be a configuration issue. Can you post the stacktrace for the AssertionError? – euronion Aug 02 '23 at 13:21
  • @euronion thanks for your time. I have edited original question to include stacktrace. I have config/config.yaml in place with all the default values. – Dakait Aug 02 '23 at 13:35
  • 2
    Thanks. This seems like a regression in the current upstream `master`. As a workaround you could set the `underground` attribute of line 5795 to `False` in the PyPSA `elec_s.nc`. A bug report on this in the GitHub repository would be welcome. – euronion Aug 03 '23 at 14:33
  • Thanks for your time. That actually helped. – Dakait Aug 03 '23 at 18:33

1 Answers1

2

Now fixed in PyPSA-Eur master via https://github.com/PyPSA/pypsa-eur/pull/714.