fix: filter out unbounded rhs in lp-polars#502
Conversation
|
I would rather lean towards inplace modifications, for the reason of not having another state of the same model. It could be confusing for users who investigate the LP file, since it's not mirroring their linopy representation. Otherwise, what about moving it to a |
|
I would rather sanitize on every export, ie default to I think we would have to rework how sanitize works at the moment, i find it honestly quite confusing: import linopy
m = linopy.Model()
x = m.add_variables(lower=0, upper=inf, name='x')
m.add_constraints(2 * x <= inf, name="inf")
m.add_constraints(x >= 2, name="lower bound")Then you have: includes it literally. If i apply No indication that something happened here (i don't even understand yet, why). What happened was that
|
Changes proposed in this Pull Request
For eventually deprecating
sanitize_infinities, this PR proposes to only remove them during lp file generation, rather than removing them inplace.This also aligns the behaviour of infinities across
m.solve()where they are removed (due tosanitize_infinities = True), andm.to_file("...lp")where they are written down@fneum @FabianHofmann If we agree this is sensible behaviour, i would:
m.solve)What do you think?
Checklist
doc.doc/release_notes.rstof the upcoming release is included.