Skip to content

Commit 1ccea4b

Browse files
committed
DOC(terms): +plottable
1 parent 86b252c commit 1ccea4b

File tree

5 files changed

+16
-6
lines changed

5 files changed

+16
-6
lines changed

docs/source/arch.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,16 @@ Architecture
332332
(after a successful intermediate :term:`compilation`), or manually,
333333
by calling :func:`.reset_abort()`.
334334

335+
plottable
336+
Objects that can plot their graph network, such as those inheriting :class:`.Plottable`,
337+
(:class:`.NetworkOperation`, :class:`.Network`, :class:`.ExecutionPlan`m :class:`.Solution`)
338+
or a |pydot.Dot|_ instance (the result of the :meth:`Plottable.plot()` method).
339+
340+
Such objects may render as SVG in *Jupter notebooks* (through their ``plot()`` method)
341+
and can render in a Sphinx site with with the :rst:dir:`graphtik` *RsT directive*.
342+
You may control the rendered image as explained in the *tip* of
343+
the :ref:`plotting` section.
344+
335345

336346
.. default-role:: obj
337347
.. |v410-flowchart| raw:: html

docs/source/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ Run the graph-operation and request a subset of the outputs:
111111
>>> solution
112112
{'a_minus_ab': -8}
113113

114-
Solutions are plottable as well:
114+
Solutions are :term:`plottable` as well:
115115

116116
>>> solution.plot('solution.svg') # doctest: +SKIP
117117

docs/source/plotting.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Plotting
88
--------
99

1010
For :ref:`debugging` it is necessary to visualize the graph-operation.
11-
You may plot the original plot and annotate on top the *execution plan* and
11+
You may plot any :term:`plottable` and annotate on top the *execution plan* and
1212
solution of the last computation, calling methods with arguments like this::
1313

1414
netop.plot(show=True) # open a matplotlib window
@@ -232,8 +232,8 @@ which you may :graphtik:`reference <addmul-anchor>` with this syntax:
232232
the code contains just one variable assignment receiving a subclass
233233
of :class:`.Plottable` or |pydot.Dot|_ instance.
234234

235-
Additionally, the doctest code producing the *plottable* does not have to be contained
236-
in the *graphtik* directive.
235+
Additionally, the doctest code producing the :term:`plottable`\s does not have
236+
to be contained in the *graphtik* directive as a whole.
237237

238238
So the above could have been written simply like this:
239239

graphtik/plot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ def supported_plot_formats() -> List[str]:
389389

390390
def render_pydot(dot: pydot.Dot, filename=None, show=False, jupyter_render: str = None):
391391
"""
392-
Render a |pydot.Dot|_ instance with `Graphviz`_ in a file/matplotlib or return it for Jupyter.
392+
Render a |pydot.Dot|_ instance with `Graphviz`_ in a file and/or in a matplotlib window.
393393
394394
:param dot:
395395
the pre-built |pydot.Dot|_ instance

graphtik/sphinxext/_graphtikbuilder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def __setitem__(self, k, v):
3636

3737

3838
class GraphtikPlotsBuilder(doctestglobs.ExposeGlobalsDocTestBuilder):
39-
"""Retrieve *plottable* from doctests globals and render them. """
39+
"""Retrieve a :term:`plottable` from doctests globals and render them. """
4040

4141
run_empty_code = True
4242

0 commit comments

Comments
 (0)