PyPSA / linopy

Linear optimization with N-D labeled arrays in Python
https://linopy.readthedocs.io
MIT License
165 stars 51 forks source link

io: write out lp file with sliced variables and constraints #365

Closed FabianHofmann closed 1 month ago

FabianHofmann commented 1 month ago

When writing out an LP file, large variables and constraints are now chunked to avoid memory issues. This is especially useful for large models with constraints with many terms. The chunk size can be set with the slice_size argument in the solve function.

@koen-vg I think we are merging this quite soon, could you have a try with your large pypsa-eur myopic network? I hope this will finally fix the issues.

koen-vg commented 1 month ago

I would love to try this out, at a conference now so I can't promise to be very quick about it, but I'll report back as soon as I've tested this.

FabianHofmann commented 1 month ago

@koen-vg thanks, sure, take your time. @lkstrp merging this as non-intrusive and well tested