Skip to content

Fix deprecation warning in NonlinearToPWL from LinearRepnVisitor#3752

Merged
blnicho merged 3 commits intoPyomo:mainfrom
AlexGisi:fix-deprecation
Oct 17, 2025
Merged

Fix deprecation warning in NonlinearToPWL from LinearRepnVisitor#3752
blnicho merged 3 commits intoPyomo:mainfrom
AlexGisi:fix-deprecation

Conversation

@AlexGisi
Copy link
Copy Markdown
Contributor

Fixes # .

  • Get rid of deprecation warning when calling NonlinearToPWL transformation

Summary/Motivation:

Remove deprecation warning

Changes proposed in this PR:

  • In NonlineartoPwl constructor, pass VarRecorder instead of individual arguments.

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
Copy link
Copy Markdown

codecov bot commented Oct 15, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.86%. Comparing base (740750d) to head (7cdf08f).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3752      +/-   ##
==========================================
- Coverage   89.18%   87.86%   -1.32%     
==========================================
  Files         896      896              
  Lines      103725   103725              
==========================================
- Hits        92508    91141    -1367     
- Misses      11217    12584    +1367     
Flag Coverage Δ
builders 29.10% <100.00%> (+0.01%) ⬆️
default 85.75% <100.00%> (?)
expensive 35.71% <100.00%> (?)
linux 32.97% <100.00%> (-55.96%) ⬇️
linux_other 32.97% <100.00%> (-54.02%) ⬇️
osx ?
win ?
win_other ?

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.

@AlexGisi
Copy link
Copy Markdown
Contributor Author

AlexGisi commented Oct 15, 2025

Turns out it wanted the OrderedVarRecorder. After fixing, it still fails the test pyomo/contrib/piecewise/tests/test_nonlinear_to_pwl.py::TestNonlinearToPWLIntegration::test_transform_and_solve_additively_decomposes_model, but that also fails, in the same way, without the change in this PR.

edit: that failure was due to #3753

@blnicho
Copy link
Copy Markdown
Member

blnicho commented Oct 15, 2025

@AlexGisi the pypy failure is an infrastructure issue unrelated to your changes. I'm working on a fix in a separate branch.

Copy link
Copy Markdown
Contributor

@emma58 emma58 left a comment

Choose a reason for hiding this comment

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

This looks good, thank you for making the change!

@github-project-automation github-project-automation bot moved this from Todo to Reviewer Approved in Pyomo 6.9.5 Release Oct 15, 2025
@blnicho blnicho merged commit b2d3a2e into Pyomo:main Oct 17, 2025
70 of 71 checks passed
@github-project-automation github-project-automation bot moved this from Reviewer Approved to Done in Pyomo 6.9.5 Release Oct 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

No open projects

Development

Successfully merging this pull request may close these issues.

5 participants