Skip to content

Conversation

@Robbybp
Copy link
Contributor

@Robbybp Robbybp commented Mar 23, 2024

Summary/Motivation:

Thanks to a casual comment by @jeanpaulwatson, and because I've spent way too many hours reproducing these plots over and over, I'd like to add a method plot a model's incidence matrix in Dulmage-Mendelsohn order.

Changes proposed in this PR:

  • spy_dulmage_mendelsohn function that plots incidence matrix on Matplotlib Axes in Dulmage-Mendelsohn order.

I've tried to automatically compute a markersize that seems to work for both small and large-ish systems. For a small model, we get something like:
dm-auto-small

For a large-ish model, we get something like (with include_wellconstrained=False):
dm-auto-large

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.

@Robbybp
Copy link
Contributor Author

Robbybp commented Mar 24, 2024

Windows coverage failure appears unrelated.

@mrmundt
Copy link
Contributor

mrmundt commented Mar 25, 2024

Windows coverage failure appears unrelated.

Coverage failures are, 99.99999% of the time, unrelated. (And also obnoxious.)

@codecov
Copy link

codecov bot commented Mar 25, 2024

Codecov Report

Attention: Patch coverage is 90.90909% with 7 lines in your changes are missing coverage. Please review.

Project coverage is 88.24%. Comparing base (c849905) to head (065b422).
Report is 6 commits behind head on main.

Files Patch % Lines
pyomo/contrib/incidence_analysis/visualize.py 90.54% 7 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3207      +/-   ##
==========================================
- Coverage   88.40%   88.24%   -0.16%     
==========================================
  Files         846      847       +1     
  Lines       95156    95402     +246     
==========================================
+ Hits        84118    84189      +71     
- Misses      11038    11213     +175     
Flag Coverage Δ
linux 86.34% <90.90%> (+<0.01%) ⬆️
osx 76.18% <90.90%> (+0.01%) ⬆️
other 86.53% <90.90%> (-0.01%) ⬇️
win 83.83% <90.90%> (-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.

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.

I have one minor docstring edit but otherwise this looks good!

@mrmundt mrmundt merged commit de5299e into Pyomo:main Apr 1, 2024
@Robbybp Robbybp deleted the incidence-reorder branch April 1, 2024 20:16
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