Skip to content

Extend pwl approximation init method to support higher initial points and single solve. - #4028

Open
stephenscini wants to merge 15 commits into
Pyomo:mainfrom
stephenscini:pwl_init_expanded_options
Open

Extend pwl approximation init method to support higher initial points and single solve.#4028
stephenscini wants to merge 15 commits into
Pyomo:mainfrom
stephenscini:pwl_init_expanded_options

Conversation

@stephenscini

@stephenscini stephenscini commented Aug 20, 2026

Copy link
Copy Markdown
Member

Fixes # .

Summary/Motivation:

If users want to create pwl approximations with more than 2 initial points, this was not possible in previous iteration. With ability more fine-tuned approximations, also added options for single solve support similar to global method.

Changes proposed in this PR:

  • More options in pwl approx initialization method
  • Added testing

AI-Use Disclosure

  • AI tools were NOT used during the preparation of this PR

or

  • AI tools contributed to the development of this PR

    • AI tools generated documentation (including the PR description/comments, code comments, and/or Sphinx documentation)
    • AI tools generated tests (baselines, examples, and/or code)
    • AI tools generated code (apart from tests)

    Review process (select ONE):

    • Rewritten: All AI-generated content was rewritten by me before being committed.
    • Reviewed/verified: I retained AI-generated content and verified it before committing. Verification included (as applicable):
      • Ran the code and fixed issues
      • Added and ran tests
      • Checked correctness/logic of code and tests
      • Checked for alignment with the contribution guide
      • Considered security implications
    • As-is: AI-generated content was commited directly to the repository

Notes for reviewers (optional):

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.

@sscini

sscini commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

@michaelbynum Should be ready for review. osx/3.14 timed out if you could please rerun but all others passing. Thanks!

Comment thread pyomo/devel/initialization/pwl_init.py Outdated
Comment thread pyomo/devel/initialization/pwl_init.py Outdated
stephenscini and others added 2 commits August 25, 2026 12:50
Co-authored-by: Miranda Mundt <55767766+mrmundt@users.noreply.github.com>
Co-authored-by: Miranda Mundt <55767766+mrmundt@users.noreply.github.com>
@stephenscini
stephenscini requested a review from mrmundt August 25, 2026 18:52

@blnicho blnicho left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I have one minor question but otherwise I think this looks fine.

Comment thread pyomo/devel/initialization/pwl_init.py Outdated
@codecov

codecov Bot commented Sep 7, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 72.00000% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.94%. Comparing base (e099f64) to head (7d3d1df).

Files with missing lines Patch % Lines
pyomo/devel/initialization/pwl_init.py 75.00% 6 Missing ⚠️
...evel/initialization/examples/init_polynomial_ex.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4028   +/-   ##
=======================================
  Coverage   89.94%   89.94%           
=======================================
  Files         917      917           
  Lines      109261   109281   +20     
=======================================
+ Hits        98276    98298   +22     
+ Misses      10985    10983    -2     
Flag Coverage Δ
builders 29.12% <20.00%> (+<0.01%) ⬆️
default 86.14% <72.00%> (?)
expensive 35.10% <20.00%> (?)
linux 87.67% <72.00%> (-1.98%) ⬇️
linux_other 87.67% <72.00%> (-0.01%) ⬇️
oldsolvers 27.58% <20.00%> (+<0.01%) ⬆️
osx 83.12% <72.00%> (-0.01%) ⬇️
win 85.44% <72.00%> (+<0.01%) ⬆️

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.

@michaelbynum michaelbynum left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good. I have one question.

Comment thread pyomo/devel/initialization/pwl_init.py Outdated
Comment thread pyomo/devel/initialization/pwl_init.py Outdated
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.

6 participants