pypsa-meets-earth / pypsa-earth

PyPSA-Earth: A flexible Python-based open optimisation model to study energy system futures around the world.
https://pypsa-earth.readthedocs.io/en/latest/
226 stars 177 forks source link

Integrate Linopy #494

Open pz-max opened 1 year ago

pz-max commented 1 year ago

Linopy was recently integrated into PyPSA --see PR here. With the new PyPSA release, we should make sure to get it into PyPSA-Earth/ PyPSA-Eur ASAP. One can already trial in a draft PR how we can use these upcoming functions. As one can see in the PR above, there is also excellent documentation on how to transition.

For context, Pyomo is the standard optimization interface for Python. For large linear programming/ MILP problems, however, Pyomo has quite poor performance. It made for years Python speed and memory-wise uncompetitive compared to other programming languages. Tom, Fabian and Jonas, worked on alternative called 'nomopyomo'. While this lead to a massive performance boost, the usability/flexibility was suffering a bit. Linopy was about the same speed boost as nomopyomo, better memory performance than 'nomopyomo' and is doing a fantastic job in comparison to other 'solver interfaces'. The benchmark with Linopy, Jump and Pyomo, only shows how important the move towards Linopy is.

pz-max commented 1 year ago

Integration available here: https://github.com/PyPSA/pypsa-eur/pull/625 Could now be integrated in PyPSA-Earth

@Hazem-IEG do you use in PyPSA-Earth-Sec any of the solve_all_networks funtions? Do you think we can integrate Linopy in PyPSA-Earth without breaking anything in the Sec version?

davide-f commented 1 year ago

Integration available here: PyPSA/pypsa-eur#625 Could now be integrated in PyPSA-Earth

@Hazem-IEG do you use in PyPSA-Earth-Sec any of the solve_all_networks funtions? Do you think we can integrate Linopy in PyPSA-Earth without breaking anything in the Sec version?

Personally, I think we could think about this after we merge the repositories. My feeling is that merging the repository may be of a priority and also syncing the developments to use linopy in both earth and sec versions while also doing the merge afterwards may make things more complex