PyPSA / linopy

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

support for warmstart in HiGHS #309

Closed fneum closed 18 hours ago

fneum commented 1 week ago

It adds support for reading in solution or basis files for a warm start and functionality to write solution and basis files from solved HiGHS models.

I am currently identifying the kind of warm start (solution or basis) by the file suffix. Is this the best way? The documentation of the Model.solve() function currently states it's only a basis file that is used for the warm start (and that's how we have done it for the other solvers.)

The writing functions do not throw errors for unsolved models, so I am not handling these.

The 0 for writing the solution indicates the format of the .sol file. I am choosing raw.

codecov[bot] commented 1 week ago

Codecov Report

Attention: Patch coverage is 72.72727% with 3 lines in your changes missing coverage. Please review.

Project coverage is 89.66%. Comparing base (2fc1c1b) to head (169a7d9).

Files Patch % Lines
linopy/solvers.py 72.72% 1 Missing and 2 partials :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #309 +/- ## ========================================== - Coverage 89.72% 89.66% -0.06% ========================================== Files 16 16 Lines 4037 4046 +9 Branches 942 945 +3 ========================================== + Hits 3622 3628 +6 - Misses 282 283 +1 - Partials 133 135 +2 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.