Skip to content

[Pyomo.DoE] update documentation#3812

Merged
blnicho merged 39 commits intoPyomo:mainfrom
smondal13:doe-update-documentation
Mar 19, 2026
Merged

[Pyomo.DoE] update documentation#3812
blnicho merged 39 commits intoPyomo:mainfrom
smondal13:doe-update-documentation

Conversation

@smondal13
Copy link
Contributor

Fixes # .

Summary/Motivation:

Pyomo.DoE documentation was old and needed an update.

Changes proposed in this PR:

  • Update the Pyomo.DoE documentation with the latest enhancements.

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.

@mrmundt
Copy link
Contributor

mrmundt commented Jan 9, 2026

@smondal13 - We have standardized to "Parmest" or "parmest", not "ParmEst". It's the source of the typo checker yelling at you.

@smondal13
Copy link
Contributor Author

Thank you @mrmundt

@smondal13
Copy link
Contributor Author

smondal13 commented Jan 9, 2026

@adowling2 @blnicho This PR is ready for review

Note: Merge PR #3803 before this one. The documentation in this PR contains updated information from that PR

:end-before: End sensitivity analysis

An example output of the code above, a design exploration for the initial concentration and temperature as experimental design variables with 9 values, produces the four figures summarized below:
.. code-block:: python
Copy link
Member

Choose a reason for hiding this comment

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

Why are you embedding the example instead of using .. literalinclude::? As implemented, this example is no longer being tested (which is a problem).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I copied and pasted the code from the example to skip the booleans that we have in the original example. However, I agree that testing this is important. So, I have added .. literalinclude:: and removed the copy-pasted code.

@codecov
Copy link

codecov bot commented Jan 12, 2026

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 89.68%. Comparing base (7ad143c) to head (a4334b3).
⚠️ Report is 61 commits behind head on main.

Files with missing lines Patch % Lines
pyomo/contrib/doe/examples/reactor_example.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3812      +/-   ##
==========================================
+ Coverage   89.67%   89.68%   +0.01%     
==========================================
  Files         908      908              
  Lines      106735   106845     +110     
==========================================
+ Hits        95717    95827     +110     
  Misses      11018    11018              
Flag Coverage Δ
builders 29.08% <0.00%> (-0.01%) ⬇️
default 85.96% <0.00%> (?)
expensive 35.51% <0.00%> (?)
linux 87.14% <0.00%> (-2.03%) ⬇️
linux_other 87.14% <0.00%> (+<0.01%) ⬆️
oldsolvers 28.00% <0.00%> (+<0.01%) ⬆️
osx 82.47% <0.00%> (+0.43%) ⬆️
win 85.56% <0.00%> (+<0.01%) ⬆️
win_other 85.56% <0.00%> (+<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.

@blnicho blnicho self-requested a review January 13, 2026 19:47
@smondal13 smondal13 changed the title Pyomo.Doe: update documentation [Pyomo.DoE] update documentation Jan 29, 2026
@sscini sscini moved this to Ready for final review in ParmEst & Pyomo.DoE Development Feb 6, 2026
Copy link
Member

@adowling2 adowling2 left a comment

Choose a reason for hiding this comment

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

Please update the list of contributors.

Should we also add the figures that explain the experiment abstraction? Or should we instead link to our workshop material? https://dowlinglab.github.io/pyomo-doe/Readme.html

**Pyomo.DoE** (Pyomo Design of Experiments) is a Python library for model-based design of experiments using science-based models.

Pyomo.DoE was developed by **Jialu Wang** and **Alexander W. Dowling** at the University of Notre Dame as part of the `Carbon Capture Simulation for Industry Impact (CCSI2) <https://github.com/CCSI-Toolset/>`_.
Pyomo.DoE was developed by **Jialu Wang** and **Alexander W. Dowling** at the
Copy link
Member

Choose a reason for hiding this comment

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

Let's expand this text to say "Pyomo.DoE was originally created by ... as part of the ... Significant improvements and extensions were contributed by (list people) with funding from (list and link to PrOMMiS) and the University of Notre Dame.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In my opinion, adding a link to the workshop material is more valuable since it has more content and is more detailed. If we are adding link, should we add it at the end, saying that more details about it can be found there?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@adowling2 I have updated the list of contributors based on the ACC workshop page. Let me know if I need to correct anything.

@blnicho blnicho removed this from Pyomo 6.10 Feb 11, 2026
@blnicho
Copy link
Member

blnicho commented Feb 20, 2026

@smondal13 we cancelled tests for now so we can divert all testing resources to cutting the release. I'll restart tests on this once we're done.

E-optimality we want to maximize the objective function, while for A- and Modified
E-optimality we want to minimize the objective function.

However, in this sensitivity analysis plot (heatmap), we only varied the initial
Copy link
Contributor Author

@smondal13 smondal13 Feb 23, 2026

Choose a reason for hiding this comment

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

@blnicho, following a discussion with @adowling2 regarding the sharp change in the heatmaps at 300K, I've added a new section (L343-369) to clarify this behavior as per @adowling2's suggestion. We agreed this was a critical detail to highlight. I intentionally left out the deep mathematical breakdown to keep the explanation conceptual and accessible for a tutorial.

Copy link
Member

@adowling2 adowling2 left a comment

Choose a reason for hiding this comment

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

@smondal13 Minor comments to update a little math. After this change, I think it is ready to merge.

* - D-optimality
- :math:`\text{det}({\mathbf{M}})`
- Volume of the confidence ellipse
- Volume of the confidence ellipse (derived from the Fisher Information Matrix)
Copy link
Member

Choose a reason for hiding this comment

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

These edits are a little confusing. This should just be the volume of the confidence ellipse. det(M) = 1 / det(V) where M = V^{-1}. This is due to properties of eigenvalues

Copy link
Contributor Author

@smondal13 smondal13 Mar 6, 2026

Choose a reason for hiding this comment

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

@adowling2 A confidence ellipse is usually drawn from the covariance matrix. Since we are solving maximization ( max log-determinant ) problem, then in our case, if we use D-optimality = volume of the confidence ellipse, it would mean that we are maximizing the volume of the confidence ellipse drawn from the covariance matrix. That's why I wanted to be clear. What do you think is the best way to avoid that?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This led to the subsequent changes in the geometric interpretation as well.

Copy link
Member

Choose a reason for hiding this comment

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

Work out the math on paper with the eigenvalues. This will show the equivalence of the geometric interpretations.

Copy link
Contributor Author

@smondal13 smondal13 Mar 6, 2026

Choose a reason for hiding this comment

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

I know they are equivalent: max log_det (M) is equivalent to min (log_det(M^-1)) for design. That is not what I am worried about.

In line 100, we defined the problem as a maximization problem. So, if we just say "D-optimality is Volume of the confidence ellipse", and then set the problem as a maximization problem, then that would mean we are saying D-optimal criterion is maximizing the volume of the confidence ellipse, which is drawn from the covariance matrix ( V= M^-1). But that would be incorrect since the D-optimality criterion means either maximizing the volume of FIM or minimizing the volume of V=M^-1 (confidence ellipse).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@adowling2 Following our discussion, I have implemented the suggestion so that it becomes clear to the reader. Please check at your earliest convenience.

@blnicho
Copy link
Member

blnicho commented Mar 6, 2026

@smondal13 our testing infrastructure is back up and running. Merge main into your branch to get tests passing.

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

@smondal13 thanks for addressing my previous comments and clarifying the heatmaps in the tutorial results. I think this is very close but I did find some small grammatical typos and a couple sections that aren't being rendered on ReadtheDocs correctly. Once those are fixed, this can be merged.

Comment on lines +291 to +295
.. literalinclude:: /../../pyomo/contrib/doe/examples/reactor_example.py
:start-after: Read in file
:end-before: End sensitivity analysis
:language: python
:start-after: # This software is distributed under the 3-clause BSD License.
:end-before: if __name__ == "__main__":
:linenos:
Copy link
Member

Choose a reason for hiding this comment

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

This code block isn't rendering in the docs

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is rendering now

smondal13 and others added 2 commits March 18, 2026 10:24
Correct typos and minor grammatical errors

Co-authored-by: Bethany Nicholson <blnicho@users.noreply.github.com>
- Added clarity to the documentation regarding the use of the `label_experiment` method.
- Replaced doctest with literalinclude for better code example integration in `doe.rst`.
- Added missing import section in `reactor_example.py` and removed unnecessary blank lines in `reactor_experiment.py`.
@mrmundt
Copy link
Contributor

mrmundt commented Mar 19, 2026

@adowling2 - Happy to wait to merge if you'd like to review again. Just let us know!

@blnicho blnicho merged commit 509f0d1 into Pyomo:main Mar 19, 2026
34 of 35 checks passed
@github-project-automation github-project-automation bot moved this from Ready for final review to Done in ParmEst & Pyomo.DoE Development Mar 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Development

Successfully merging this pull request may close these issues.

7 participants