Skip to content

KKT Transform Code Refactor#3881

Open
ChrisLaliwala wants to merge 40 commits intoPyomo:mainfrom
ChrisLaliwala:kkt-transform-refactor
Open

KKT Transform Code Refactor#3881
ChrisLaliwala wants to merge 40 commits intoPyomo:mainfrom
ChrisLaliwala:kkt-transform-refactor

Conversation

@ChrisLaliwala
Copy link
Copy Markdown

@ChrisLaliwala ChrisLaliwala commented Mar 24, 2026

Fixes # .

Summary/Motivation:

This PR refactors the KKT transformation code (see PR #3860) to make it more efficient. In the original PR, it was suggested by @jsiirola that the order of operations be reversed to avoid repeated work and the use of unintuitive data structures.

Changes proposed in this PR:

  • Refactors code to increase efficiency
  • Simplifies API for getting multipliers/components from model

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.

ChrisLaliwala and others added 29 commits February 24, 2026 12:20
Co-authored-by: Bethany Nicholson <blnicho@users.noreply.github.com>
Co-authored-by: John Siirola <jsiirola@users.noreply.github.com>
Co-authored-by: John Siirola <jsiirola@users.noreply.github.com>
Co-authored-by: John Siirola <jsiirola@users.noreply.github.com>
Co-authored-by: John Siirola <jsiirola@users.noreply.github.com>
Co-authored-by: John Siirola <jsiirola@users.noreply.github.com>
Co-authored-by: John Siirola <jsiirola@users.noreply.github.com>
…mo into kkt-transform

need to fix merge conflicts.
@ChrisLaliwala ChrisLaliwala changed the title Kkt transform refactor KKT Transform Code Refactor Mar 24, 2026
@ChrisLaliwala
Copy link
Copy Markdown
Author

@jsiirola

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 25, 2026

Codecov Report

❌ Patch coverage is 99.09091% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 89.94%. Comparing base (6baac63) to head (e4c8a56).

Files with missing lines Patch % Lines
pyomo/core/plugins/transform/kkt.py 99.09% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##             main    #3881    +/-   ##
========================================
  Coverage   89.93%   89.94%            
========================================
  Files         902      903     +1     
  Lines      106393   106503   +110     
========================================
+ Hits        95683    95791   +108     
- Misses      10710    10712     +2     
Flag Coverage Δ
builders 29.18% <19.09%> (-0.02%) ⬇️
default 86.25% <99.09%> (?)
expensive 35.62% <19.09%> (?)
linux 87.39% <99.09%> (-2.02%) ⬇️
linux_other 87.39% <99.09%> (+0.01%) ⬆️
oldsolvers 28.09% <19.09%> (-0.01%) ⬇️
osx 82.73% <99.09%> (+0.01%) ⬆️
win 85.82% <99.09%> (+<0.01%) ⬆️
win_other 85.82% <99.09%> (+<0.01%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 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.

Copy link
Copy Markdown
Member

@jsiirola jsiirola left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is really close! Just a couple minor changes...

@emma58 emma58 self-requested a review March 27, 2026 23:59
@ChrisLaliwala ChrisLaliwala requested a review from jsiirola March 31, 2026 13:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants