Export variable and constraint names in LP files#391
Export variable and constraint names in LP files#391olivierjuan wants to merge 0 commit intoPyPSA:masterfrom
Conversation
|
I'll fix the tests first |
|
I added a new io_api type called "lp-debug" to write lp file with variable and constraint names. I don't know if you will like that approach. I can replace it by an extra argument to the function to_file instead if you prefer. |
FabianHofmann
left a comment
There was a problem hiding this comment.
pretty cool @olivierjuan! Thank you for your contribution! I would suggest to have an extra argument for this and raise an error if a non-supported io-api is passed. Could you check whether this has any impact on the regular lp file writing?
|
Ok. I'm on it |
|
@FabianHofmann , I extended it to lp-polars too, and added tests to check with and without variable names. |
|
Well I did it in the end. Only CBC and GLPK are incompatible (if trying to solve with_names=True and with one of these solvers, a warning will be printed and the option will be deactivated). |
|
Wow, well done @olivierjuan ! I promise to have a look soon and then we can merge it 🚀 |
lkstrp
left a comment
There was a problem hiding this comment.
Hey @olivierjuan, thanks for the contribution! This was a requested feature
We wanna get this merged now and have only some minor changes, e.g. use explicit_coordinate_names as argument name instead.
Would you mind if I just push those changes?
|
As you want, I fine with you modifying it. |
A small modification to export LP files with variable and constraint names.
Gurobi is able to read the generated LP files.
This modification does not apply to polar export.
I'm ready to improve the code if needed
This is related to issue #157