Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Graphviz tweaks #1792

Merged
merged 3 commits into from
Sep 29, 2024
Merged

Graphviz tweaks #1792

merged 3 commits into from
Sep 29, 2024

Conversation

ischoegl
Copy link
Member

@ischoegl ischoegl commented Sep 12, 2024

Changes proposed in this pull request

This PR separates ReactorNet visualization tweaks from #1788 to facilitate further reviews.

  • Add wall names to ReactorNet graphviz illustrations.
  • Partially addresses review comment by removing diagram.view

There is a caveat here, - see Cantera/enhancements#212, - as well as per @speth's comment:

Regarding the extension of the graph idiom, I think there's a simplification that may be worth considering. Instead of seeing just Reactor and ReactorSurface objects as nodes in the graph, you could also see valves and flow devices as nodes, with the edges of the graph just being the abstract connections among all of the entities that make up the reactor network. This way, there's only the need for one new base class, and no need for anything to sit between a Reactor and a ReactorSurface. This also gets closer to the original intent of Cantera/enhancements#212, and may work better as the amount of information you might want to display about a connector increases, given some of the limitations of how Graphviz handles (or doesn't) text associated with edges. That said, I do like the Connector class as a generalization combining walls and flow devices, and there's probably some further room to adjust this idea.

On the other hand, there is @Naikless's original intent:

In classical graph terminology, when I introduced the visualization, I envisioned the flow devices and the walls as "edges" that each connect two "nodes" that are reactors or reservoirs. So now they are represented as arrows of different shape and color. This way, the direction of both material and energy flow can be indicated relatively easily. Their main property (the amount of flow) is still displayed.

Having them represented as nodes could imo quickly lead to very cluttered networks, especially since there are quite a few scenarios conceivable where two reactors have a multitude of connections to one another. But I am happy to hear your arguments on this.

This PR attempts to stick with the original intent.

If applicable, fill in the issue number this pull request is fixing

Closes Cantera/enhancements#212 (minor aspect of this PR)

If applicable, provide an example illustrating new features this pull request is introducing

Checklist

  • The pull request includes a clear description of this code change
  • Commit messages have short titles and reference relevant issues
  • Build passes (scons build & scons test) and unit tests address code coverage
  • Style & formatting of contributed code follows contributing guidelines
  • The pull request is ready for review

Copy link

codecov bot commented Sep 12, 2024

Codecov Report

Attention: Patch coverage is 71.42857% with 2 lines in your changes missing coverage. Please review.

Project coverage is 73.24%. Comparing base (ec0cfdb) to head (a8f761f).
Report is 9 commits behind head on main.

Files with missing lines Patch % Lines
interfaces/cython/cantera/drawnetwork.py 60.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1792   +/-   ##
=======================================
  Coverage   73.23%   73.24%           
=======================================
  Files         381      381           
  Lines       54375    54375           
  Branches     9251     9254    +3     
=======================================
+ Hits        39823    39826    +3     
+ Misses      11580    11578    -2     
+ Partials     2972     2971    -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ischoegl ischoegl marked this pull request as ready for review September 12, 2024 17:19
@ischoegl ischoegl requested a review from a team September 15, 2024 18:17
Copy link
Member

@speth speth left a comment

Choose a reason for hiding this comment

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

This looks good to me, pending the fix for the failing tests.

test/python/test_reactor.py Outdated Show resolved Hide resolved
@ischoegl
Copy link
Member Author

ischoegl commented Sep 29, 2024

@speth … test is fixed but we appear to have a new upstream regression with HighFive (only shows up on windows 2022, and likely related to a new conda package) ... Edit: there isn't anything new in the HighFive package since their last release in July, so it's likely some other conda-related update. As these new failures are not caused by changes in this PR, I am suggesting to handle/investigate this separately.

@ischoegl ischoegl requested a review from speth September 29, 2024 13:32
@speth speth merged commit 67ef3b4 into Cantera:main Sep 29, 2024
42 of 48 checks passed
@ischoegl ischoegl deleted the graphviz-tweaks branch September 29, 2024 18:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Identify flow devices and walls in graphviz reactor network illustrations
2 participants