Skip to content

Ranged LinearStandardFormCompiler - #3960

Open
bknueven wants to merge 24 commits into
Pyomo:mainfrom
bknueven:ranged-lsfc
Open

bknueven wants to merge 24 commits into
Pyomo:mainfrom
bknueven:ranged-lsfc

Conversation

@bknueven

@bknueven bknueven commented May 20, 2026 •

Copy link
Copy Markdown
Contributor

Fixes # N/A

Summary/Motivation:

LinearStandardFormCompiler is a great tool for rapidly expanding a Pyomo model into the form need for (mixed-integer) linear programming solvers. Many of these solvers also handle ranged (linear) constraints. This PR would augment the LinearStandardFormCompiler to return ranged linear constraints directly as part of the LinearStandardFormInfo when the new option keep_range_constraints=True.

EDIT [@jsiirola, 261115]

After talking to @bknueven, I directly implemented my PR comments into the code. This slightly changes the original PR:

  • Add a format argument to specify the target "standard" form format (instead of adding another bool option). This has the side effect of deprecating mixed_form and slack_form arguments.
  • reworked the branching logic in the constraint processor. There is a little more code (and it is a little more repetitive), but fewer overall tests and (hopefully) a little more clear what we are doing
  • expanded documentation
  • expanded tests and code coverage

Changes proposed in this PR:

This PR was created with the help of GitHub Copilot CLI.

Legal Acknowledgement

By contributing to this software project, I have read the contribution guide and agree to the following terms and conditions for my contribution:

  1. I agree my contributions are submitted under the BSD license.
  2. I represent I am authorized to make the contributions and grant the license. If my employer has rights to intellectual property that includes these contributions, I represent that I have received permission to make contributions and grant the required license on behalf of that employer.

@codecov

codecov Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.25%. Comparing base (4a83eef) to head (b769be6).
⚠️ Report is 10 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3960      +/-   ##
==========================================
+ Coverage   90.23%   90.25%   +0.02%     
==========================================
  Files         919      919              
  Lines      109467   109551      +84     
==========================================
+ Hits        98773    98880     +107     
+ Misses      10694    10671      -23     
Flag Coverage Δ
builders 29.12% <15.45%> (-0.01%) ⬇️
default 86.45% <100.00%> (?)
expensive 35.21% <15.45%> (?)
linux 87.78% <100.00%> (-1.95%) ⬇️
linux_other 87.78% <100.00%> (+0.02%) ⬆️
oldsolvers 28.02% <15.45%> (-0.01%) ⬇️
osx 83.24% <100.00%> (+0.03%) ⬆️
win 85.55% <100.00%> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@blnicho blnicho moved this from Todo to Review In Progress in November 2026 Release Nov 10, 2026
@github-project-automation github-project-automation Bot moved this from Review In Progress to Reviewer Approved in November 2026 Release Nov 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Reviewer Approved

Development

Successfully merging this pull request may close these issues.

4 participants