PyPSA / pypsa-eur

PyPSA-Eur: A Sector-Coupled Open Optimisation Model of the European Energy System
https://pypsa-eur.readthedocs.io/
338 stars 238 forks source link

`remove_stubs: false` not supported #843

Closed koen-vg closed 6 months ago

koen-vg commented 10 months ago

Checklist

Describe the Bug

It must have a been a while ago that the clustering["simplify_network"]["remove_stubs"] configuration option actually worked. Right now, when set to false, the workflow actually crashes because the connection_costs output of the simplify_network rule is never produced. (This output is written by the _adjust_capital_costs_using_connection_costs function, which, slightly indirectly, is only run when the remove_stubs option is enabled.)

Moreover, when I was playing around with the option, I found several problems later in the workflow too for sector-coupled networks, apparently mostly related to DC offshore wind buses that are stubs and usually merged with onshore AC buses, but lead to problems when remove_stubs: false. This is the case only for certain countries (Germany, Sweden, possibly more).

One option would be to remove the choice altogether and just remove the configuration option.

On the other hand, not removing stubs actually helps quite a bit with the spatial representation of Northern Norway, which is the reason for me to look into the option in the first place. Right now I sort of hacked together a solution where stubs are removed everywhere but in Norway, and this basically works for me.

I'm not exactly sure what the best solution for the project overall is. If nobody else is interested in having networks with stubs, it's probably best to just remove the configuration option. If it's a clear ambition that stubs should be supported, however, the lack of functionality should at least be mentioned in the documentation.

koen-vg commented 10 months ago

Just to illustrate what I mean, here the topology of a network I'm currently working with. When stubs are removed, every node north of Lofoten (i.e. all the upper "tree-like" network extensions) are merged into more southern nodes, unfortunately removing any kind of spatial resolution in the representation of wind capacity factors, etc. bilde

koen-vg commented 9 months ago

If any of the above ideas or something else is preferred, I'd be happy to draft and submit a pull request.

fneum commented 6 months ago

closed by #1031? reopen if that's not the case