Skip to content

Sensitivity calculation for named expressions#3685

Merged
mrmundt merged 6 commits intoPyomo:mainfrom
eslickj:named_expr_sens
Aug 25, 2025
Merged

Sensitivity calculation for named expressions#3685
mrmundt merged 6 commits intoPyomo:mainfrom
eslickj:named_expr_sens

Conversation

@eslickj
Copy link
Copy Markdown
Contributor

@eslickj eslickj commented Aug 7, 2025

Fixes None

Summary/Motivation:

This adds sensitivity calculations for named expressions to the pynumero sensitivity calculations in the sensitivity toolbox. Usually, it is probably better to add a variable to the model, but on rare occasions that can cause trouble.

Changes proposed in this PR:

  • Add ability to include named expressions in sensitivity matrix

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 Aug 12, 2025

Codecov Report

❌ Patch coverage is 95.45455% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 89.29%. Comparing base (de14e28) to head (2dfff6f).
⚠️ Report is 1046 commits behind head on main.

Files with missing lines Patch % Lines
pyomo/contrib/sensitivity_toolbox/pynumero.py 95.45% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3685      +/-   ##
==========================================
+ Coverage   89.20%   89.29%   +0.09%     
==========================================
  Files         892      892              
  Lines      102978   104788    +1810     
==========================================
+ Hits        91857    93567    +1710     
- Misses      11121    11221     +100     
Flag Coverage Δ
builders 26.73% <9.09%> (-0.01%) ⬇️
default 85.79% <95.45%> (?)
expensive 34.08% <9.09%> (?)
linux 86.96% <95.45%> (-1.99%) ⬇️
linux_other 86.96% <95.45%> (-0.01%) ⬇️
osx 83.29% <95.45%> (+0.02%) ⬆️
win 85.17% <95.45%> (+<0.01%) ⬆️
win_other 85.17% <95.45%> (+<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.

@github-project-automation github-project-automation bot moved this from Todo to Reviewer Approved in Pyomo 6.9.4 Release Aug 12, 2025
@blnicho blnicho self-requested a review August 12, 2025 18:58
Copy link
Copy Markdown
Member

@blnicho blnicho left a comment

Choose a reason for hiding this comment

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

Two minor comments but otherwise this looks fine.

@mrmundt mrmundt merged commit 5b97f0d into Pyomo:main Aug 25, 2025
35 checks passed
@github-project-automation github-project-automation bot moved this from Reviewer Approved to Done in Pyomo 6.9.4 Release Aug 25, 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.

4 participants