linopy icon indicating copy to clipboard operation
linopy copied to clipboard

add linear expression from constant

Open RobbieKiwi opened this issue 2 months ago • 1 comments

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.rst of the upcoming release is included.
  • [X] I consent to the release of this PR's code under the MIT license.

RobbieKiwi avatar Nov 01 '25 22:11 RobbieKiwi

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

RobbieKiwi avatar Nov 01 '25 22:11 RobbieKiwi