PyPSA / pypsa-eur

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

Only add buses in specified countries #1308

Closed koen-vg closed 1 week ago

koen-vg commented 1 week ago

This is necessary for the new OSM-based base network, where loaded buses already have a "country" attribute.

Closes https://github.com/PyPSA/pypsa-eur/issues/1306

Checklist

koen-vg commented 1 week ago

If I understand the intention of dropping non-OSM support correctly, the if-statement checking if "countries" is a column in buses can be simplified once OSM is the only source. I could add a note to that effect, but it seems to me like a lot of code can be simplified at that point, so hopefully that should be obvious at that point?