Skip to content

Fix SLSQP Lagrange multiplier extraction - #493

Open
ewu63 wants to merge 4 commits into
mainfrom
bugfix/slsqp-lambda
Open

ewu63 wants to merge 4 commits into
mainfrom
bugfix/slsqp-lambda

Conversation

@ewu63

@ewu63 ewu63 commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator

Purpose

SLSQP Lagrange multiplier was broken previously, it is fixed here and turns out to be easier than I thought.

Expected time until merged

Would be nice to sneak into this upcoming release.

Type of change

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (non-backwards-compatible fix or feature)
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no API changes)
  • Documentation update
  • Maintenance update
  • Other (please describe)

Testing

Added to existing hs071 test.

Checklist

  • I have run ruff check and ruff format to make sure the Python code adheres to PEP-8 and is consistently formatted
  • I have formatted the Fortran code with fprettify or C/C++ code with clang-format as applicable
  • I have run unit and regression tests which pass locally with my changes
  • I have added new tests that prove my fix is effective or that my feature works
  • I have added necessary documentation

@ewu63
ewu63 requested a review from marcomangano as a code owner September 9, 2026 05:52
@codecov

codecov Bot commented Sep 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 54.22%. Comparing base (43e2e55) to head (263ecd6).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #493   +/-   ##
=======================================
  Coverage   54.22%   54.22%           
=======================================
  Files           1        1           
  Lines         225      225           
=======================================
  Hits          122      122           
  Misses        103      103           

☔ 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.

# getOrdering). slfunc/slgrad negate fcon/gcon before handing them to SLSQP
# (since SLSQP expects constraints of the form c(x) >= 0), so the returned
# multipliers must be negated to match pyOptSparse's constraint sign convention.
lambdaStar = -w[:m]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Should we keep this consistent with the original notation and just flip the sign for testing purposes, like we do for IPOPT here?

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.

2 participants