You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Python ReactionPathDiagram class could be extended to provide a graph representation of the reaction paths using Python's native data types. This would allow users to perform operations on the reaction network using tools for working with graphs, such as NetworkX or graph-tool, enabling new opportunities for analysis and presentation of reaction networks.
This would provide a means of implementing #4 and #26 as part of the Python interface.
Motivation
Describe the need for the proposed change:
What problem is it trying to solve?
The existing ReactionPathDiagram class in Python is mostly limited to just providing a few output formatting options for graphviz.
Who is affected by the change?
Users who want to perform analysis of reaction pathways and generate custom visualizations
Why is this a good solution?
Provides flexibility for users to work with the graph library of their choice, and avoids re-inventing the wheel by implementing graph algorithms in Cantera
Possible Solutions
The reaction path diagram can be represented as a list of nodes (species) and a list of directed edges (fluxes). This could be converted to Python using the AnyMap class as an intermediary, with a structure such as:
I like this idea. I've sometimes needed things like a cumulative flux analysis rather than instantaneous. I think this could maybe simplify implementation of such things.
I also sometimes like to reformat graphviz dot file output. Eg changing styles, or putting pictures of molecules in place of names. Not sure what is the best way to enable such customization (I used to run regular expressions over the Cantera-generated .dot file) but maybe now is the time to think about it.
Update: I came across this gist with some of my flux diagram stuff.
Abstract
The Python
ReactionPathDiagram
class could be extended to provide a graph representation of the reaction paths using Python's native data types. This would allow users to perform operations on the reaction network using tools for working with graphs, such as NetworkX or graph-tool, enabling new opportunities for analysis and presentation of reaction networks.This would provide a means of implementing #4 and #26 as part of the Python interface.
Motivation
Describe the need for the proposed change:
ReactionPathDiagram
class in Python is mostly limited to just providing a few output formatting options for graphviz.Possible Solutions
The reaction path diagram can be represented as a list of nodes (species) and a list of directed edges (fluxes). This could be converted to Python using the
AnyMap
class as an intermediary, with a structure such as:This structure lends itself to easily being convertible to a NetworkX
DiGraph
object. For example:The text was updated successfully, but these errors were encountered: