Skip to content

Diagnostics report for structured flowsheet wrapper#1742

Open
dangunter wants to merge 16 commits intoIDAES:mainfrom
dangunter:structfs-diagnostics-1741
Open

Diagnostics report for structured flowsheet wrapper#1742
dangunter wants to merge 16 commits intoIDAES:mainfrom
dangunter:structfs-diagnostics-1741

Conversation

@dangunter
Copy link
Member

Fixes

Fixes #1741

Summary/Motivation:

Changes proposed in this PR:

Legal Acknowledgement

By contributing to this software project, I agree to the following terms and conditions for my contribution:

  1. I agree my contributions are submitted under the license terms described in the LICENSE.txt file at the top level of this directory.
  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.

Copy link
Contributor

@dallan-keylogic dallan-keylogic left a comment

Choose a reason for hiding this comment

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

We should think about how the Diagnostics Toolbox returns data. In this PR, the text stream from the Diagnostics Toolbox is parsed in order to make the data available through the GUI, but it might make sense for the DiagnosticsToolbox to return StructuralData and NumericalData classes, and then we can either write the report or make the data available in the GUI from that.

@andrewlee94 told me that he was going to open a couple of PRs breaking the diagnostics_toolbox.py file into smaller subfiles and making them compatible with the Pyomo GreyBox interface, so if we elect to change what the DiagnosticsToolbox outputs, then we should wait into those PRs are merged in.

Comment on lines +185 to +204
if "degree" in msg_lower and "freedom" in msg_lower:
category = "degrees_of_freedom"
elif "inconsistent units" in msg_lower:
category = "inconsistent_units"
elif "structural singularity" in msg_lower:
category = "structural_singularity"
elif "evaluation errors" in msg_lower:
category = "evaluation_errors"
elif "fixed to 0" in msg_lower:
category = "fixed_to_zero"
elif "unused variable" in msg_lower or "unused variables" in msg_lower:
category = "unused_variables"

return StructuralIssueData(
kind=kind,
category=category,
count=count,
message=body,
details=lines[1:],
)
Copy link
Contributor

Choose a reason for hiding this comment

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

It might be better, in the long run, for the Diagnostics Toolbox to return these data objects directly and then generate a report from that rather than writing a report to a stream and parsing it after the fact.

Copy link
Member Author

Choose a reason for hiding this comment

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

I agree. In that case it would make more sense to have a separate PR to make those changes, then this PR becomes much simpler -- essentially selecting which tests to run and returning the objects. @dallan-keylogic do you have any time to help with this? I need a partner in crime to at least review changes

Comment on lines +235 to +240
if line in (
"No warnings found!",
"No cautions found!",
"If you still have issues converging your model consider:",
):
continue
Copy link
Contributor

Choose a reason for hiding this comment

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

So does this section not get shown to the user at all?

Copy link
Member Author

Choose a reason for hiding this comment

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

yeah. the idea was it wasn't really that informative

@andrewlee94
Copy link
Contributor

@dangunter As @dallan-keylogic said, I have a couple of PRs on the way, of which I will hopefully have the first up today (just waiting for final internal review).

@ksbeattie ksbeattie added the Priority:Normal Normal Priority Issue or PR label Mar 5, 2026
@ksbeattie
Copy link
Member

@dangunter, I've given this (and issue #1741) "Normal" priority and on the May release board. Speak up if that's not correct.

@codecov
Copy link

codecov bot commented Mar 6, 2026

Codecov Report

❌ Patch coverage is 48.29545% with 91 lines in your changes missing coverage. Please review.
✅ Project coverage is 73.77%. Comparing base (3b76abc) to head (1d3b548).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
idaes/core/util/structfs/actions/diagnostics.py 43.88% 76 Missing and 2 partials ⚠️
idaes/core/util/structfs/fsrunner.py 58.33% 9 Missing and 1 partial ⚠️
idaes/core/util/structfs/runner_actions.py 76.92% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1742      +/-   ##
==========================================
- Coverage   73.85%   73.77%   -0.09%     
==========================================
  Files         406      407       +1     
  Lines       66081    66255     +174     
  Branches    11110    11136      +26     
==========================================
+ Hits        48803    48878      +75     
- Misses      14741    14833      +92     
- Partials     2537     2544       +7     

☔ 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

Priority:Normal Normal Priority Issue or PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add diagnostics 'action' to structfs flowsheet wrapper

4 participants