Skip to content

MPC Load Data Ignore Expressions#3868

Open
eslickj wants to merge 3 commits intoPyomo:mainfrom
eslickj:mpc_load_expr
Open

MPC Load Data Ignore Expressions#3868
eslickj wants to merge 3 commits intoPyomo:mainfrom
eslickj:mpc_load_expr

Conversation

@eslickj
Copy link
Contributor

@eslickj eslickj commented Mar 6, 2026

Fixes None

Summary/Motivation:

When loading MPC data into a model, if a data key is an Expression, the model will get messed up because the expression will be replaced. This PR makes loading MPC data into a model ignore expressions.

Changes proposed in this PR:

  • Ignore expressions when loading MPC data into a model
  • When interpolating MPC data if a data point is None make the interpolated value None

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

codecov bot commented Mar 6, 2026

Codecov Report

❌ Patch coverage is 90.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 89.60%. Comparing base (7ad143c) to head (b0eddf5).

Files with missing lines Patch % Lines
pyomo/contrib/mpc/interfaces/load_data.py 85.71% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3868      +/-   ##
==========================================
- Coverage   89.67%   89.60%   -0.08%     
==========================================
  Files         908      908              
  Lines      106735   106744       +9     
==========================================
- Hits        95717    95643      -74     
- Misses      11018    11101      +83     
Flag Coverage Δ
builders 29.08% <10.00%> (-0.01%) ⬇️
default 85.96% <90.00%> (?)
expensive 35.51% <10.00%> (?)
linux 86.71% <90.00%> (-2.46%) ⬇️
linux_other 86.71% <90.00%> (-0.43%) ⬇️
oldsolvers 28.00% <10.00%> (+<0.01%) ⬆️
osx 82.04% <90.00%> (+<0.01%) ⬆️
win 85.13% <90.00%> (-0.43%) ⬇️
win_other 85.13% <90.00%> (-0.43%) ⬇️

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.

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.

4 participants