Skip to content

Conversation

sscini
Copy link
Contributor

@sscini sscini commented Jun 27, 2025

Fixes # .

Summary/Motivation:

Currently, there is no way internally to update values for a suffix in a labeled model for parmest or DoE. This PR adds a new utility function to update suffix values when provided the model, the suffix, and the new values.

Changes proposed in this PR:

  • Addition of a utility function for Pyomo.DoE to update model suffix values.

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
Copy link
Contributor Author

sscini commented Jun 27, 2025

@adowling2 @djlaky @blnicho
Hello, this PR is ready for initial review. Currently I have only added the new function, working on an example and tests currently to add as well. All feedback appreciated.

@sscini sscini moved this from Development to Ready for design review in ParmEst & Pyomo.DoE Development Jun 27, 2025
@sscini
Copy link
Contributor Author

sscini commented Jun 27, 2025

This PR adds a new functionality that will be used in other PRs currently being drafted (#3575, #3639).
Early next week I plan to start adding:

Examples

  • Parmest example for modifying unknown parameters and experiment outputs
  • DoE example for modifying experiment inputs, experiment outputs, and measurement error

Testing

  • Tests for new examples
  • Test to show value is changed with each of 4 suffix names
  • Test to show suffix itself maintains its original value
  • Tests for all errors

Copy link

codecov bot commented Jun 29, 2025

Codecov Report

❌ Patch coverage is 97.36842% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.19%. Comparing base (d8f1ba2) to head (2767263).
⚠️ Report is 56 commits behind head on main.

Files with missing lines Patch % Lines
.../contrib/doe/examples/update_suffix_doe_example.py 96.77% 1 Missing ⚠️
...t/examples/reactor_design/update_suffix_example.py 96.77% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3650   +/-   ##
=======================================
  Coverage   89.18%   89.19%           
=======================================
  Files         890      892    +2     
  Lines      102778   102852   +74     
=======================================
+ Hits        91663    91736   +73     
- Misses      11115    11116    +1     
Flag Coverage Δ
builders 26.73% <3.94%> (-0.02%) ⬇️
default 85.78% <97.36%> (?)
expensive 34.09% <3.94%> (?)
linux 86.96% <97.36%> (-1.99%) ⬇️
linux_other 86.96% <97.36%> (+<0.01%) ⬆️
osx 83.25% <97.36%> (+0.01%) ⬆️
win 85.15% <97.36%> (+<0.01%) ⬆️
win_other 85.15% <97.36%> (+<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.

Copy link
Contributor

@mrmundt mrmundt left a comment

Choose a reason for hiding this comment

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

I approved and then thought more about it. This doesn't have any tests. Could you please add a few, even if they are just minimal gut checks?

@sscini
Copy link
Contributor Author

sscini commented Jul 1, 2025

@mrmundt Absolutely, I'm working on a small example and adding checks to show it works and make sure it catches all the errors. Thank you!

@sscini sscini moved this from Ready for design review to Testing in ParmEst & Pyomo.DoE Development Jul 1, 2025
@sscini
Copy link
Contributor Author

sscini commented Jul 1, 2025

Main talking points for meeting 7/1:

  • Main utility made
  • Use strings or an Enum to provide function?

Finished example using unknown parameters, are more needed?
Working on tests as we speak

@sscini
Copy link
Contributor Author

sscini commented Jul 1, 2025

Action items from July 1 meeting:

  • Simplify input to just provide the model.suffix directly
  • Modify example to reflect this
  • Add tests

@sscini
Copy link
Contributor Author

sscini commented Jul 2, 2025

@blnicho @mrmundt @djlaky @adowling2

Context: I developed the utility in doe/utils.py, and added tests to the doe/tests folder.

Problem: DoE tests are failing with current example for experiment outputs and measurement error, says they are uninitialized.

Proposed Solution: I made an additional example (with a parmest model) to show it works with unknown parameters, experiment outputs, and measurement_error.

Question: Would it be better for me to keep everything in contrib/doe, or can I add testing and an example in parmest using a function from doe? Trying to minimize new imports needed. Thoughts?

TLDR: Does it matter if I add items to doe and parmest contrib folders in same PR? Imports will overlap

@sscini
Copy link
Contributor Author

sscini commented Aug 4, 2025

@blnicho @mrmundt @djlaky
Thank you for your patience. Ready for final review pending final checks.

@sscini sscini requested review from blnicho and mrmundt August 4, 2025 21:19
Copy link
Contributor

@mrmundt mrmundt left a comment

Choose a reason for hiding this comment

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

Thanks for doing all this work!

@sscini
Copy link
Contributor Author

sscini commented Aug 5, 2025

@mrmundt @blnicho Please let me know if there are any tips to fix the failing tests, but I ran the tests on my machine for parmest and doe, all passed. And it looks like it might be related to something else

@mrmundt
Copy link
Contributor

mrmundt commented Aug 6, 2025

@mrmundt @blnicho Please let me know if there are any tips to fix the failing tests, but I ran the tests on my machine for parmest and doe, all passed. And it looks like it might be related to something else

Has nothing whatsoever to do with your changes. An upstream dependency released a new version that introduced this. We're looking into it.

@blnicho blnicho dismissed djlaky’s stale review August 6, 2025 04:55

All of @djlaky's comments have been resolved

@github-project-automation github-project-automation bot moved this from Review In Progress to Reviewer Approved in August 2025 Release Aug 6, 2025
@blnicho blnicho merged commit 9a7de1b into Pyomo:main Aug 6, 2025
35 checks passed
@github-project-automation github-project-automation bot moved this from Reviewer Approved to Done in August 2025 Release Aug 6, 2025
@github-project-automation github-project-automation bot moved this from Ready for final review to Done in ParmEst & Pyomo.DoE Development Aug 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

6 participants