linopy
linopy copied to clipboard
add linear expression from constant
Closes #513
Changes proposed in this Pull Request
Add LinearExpression.from_constant
Checklist
- [X] Code changes are sufficiently documented; i.e. new functions contain docstrings and further explanations may be given in
doc. - [X] Unit tests for new features were added (if applicable).
- [X] A note for the release notes
doc/release_notes.rstof the upcoming release is included. - [X] I consent to the release of this PR's code under the MIT license.
I notice an issue that if there is a linear expression that only contains constants, some of the methods seem a bit strange.
For example if I do expr.to_polars() I get a pl.DataFrame with 0 rows