shamrock.utils.plot.DotGraph#

class shamrock.utils.plot.DotGraph(dot_source)#

Bases: object

Wrap a Graphviz DOT graph source so it renders as inline SVG.

Meant to display the solver graphs produced by e.g. model.get_solver_dot_graph() or setup_node.get_dot() in the sphinx-gallery generated examples: sphinx-gallery captures the _repr_html_ of an expression left bare as the last statement of a code block (the same mechanism Jupyter uses for rich display), so no custom scraper is needed. See https://stackoverflow.com/a/65117672 for the technique this is based on.

_repr_html_ is only defined if the graphviz python package (and the Graphviz dot executable) are installed; otherwise this falls back to __repr__, i.e. the raw DOT source.

Parameters#

dot_sourcestr

Source of the graph in the DOT language.

Methods

Killing sphere for SPH simulation

Killing sphere for SPH simulation

Basic disc simulation

Basic disc simulation

Custom warp disc simulation

Custom warp disc simulation

Using Shamrock SPH rendering module

Using Shamrock SPH rendering module