Skip to content

Support evaluating PiecewiseLinearExpression objects - #4007

Open
jsiirola wants to merge 3 commits into
Pyomo:mainfrom
jsiirola:piecewise-eval
Open

Support evaluating PiecewiseLinearExpression objects#4007
jsiirola wants to merge 3 commits into
Pyomo:mainfrom
jsiirola:piecewise-eval

Conversation

@jsiirola

@jsiirola jsiirola commented Aug 12, 2026

Copy link
Copy Markdown
Member

Fixes # .

Summary/Motivation:

This resolves an oversight where expressions containing PiecewiseLinearExpression objects could bot be evaluated (e.g., using value())

Changes proposed in this PR:

  • Add support for evaluating PiecewiseLinearExpression
  • Remove redundant method definition
  • Add additional 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.

@codecov

codecov Bot commented Aug 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.94%. Comparing base (5c1ca8c) to head (fee4097).
⚠️ Report is 17 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4007   +/-   ##
=======================================
  Coverage   89.93%   89.94%           
=======================================
  Files         917      917           
  Lines      109101   109101           
=======================================
+ Hits        98124    98130    +6     
+ Misses      10977    10971    -6     
Flag Coverage Δ
builders 29.08% <50.00%> (-0.01%) ⬇️
default 86.13% <100.00%> (?)
expensive 35.07% <50.00%> (?)
linux 87.67% <100.00%> (-1.98%) ⬇️
linux_other 87.67% <100.00%> (+<0.01%) ⬆️
oldsolvers 27.56% <50.00%> (+<0.01%) ⬆️
osx 83.11% <100.00%> (+<0.01%) ⬆️
win 85.43% <100.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.

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.

1 participant