To help users document their Nipype-based code, the software is shipped with a set of extensions (currently only one) to customize the appearance and simplify the generation process.
nipype.sphinxext.plot_workflow- Workflow plotting extension¶
A directive for including a nipype workflow graph in a Sphinx document.
This code is forked from the plot_figure sphinx extension of matplotlib.
By default, in HTML output,
workflow will include a .png file with a link to a high-res .png. In LaTeX output, it will include a .pdf. The source code for the workflow may be included as inline content to the directive
.. workflow :: :graph2use: flat :simple_form: no from nipype.workflows.dmri.camino.connectivity_mapping import create_connectivity_pipeline wf = create_connectivity_pipeline()
For example, the following graph has been generated inserting the previous code block in this documentation:
workflow directive supports the following options:
workflow_include_sourcevariable in conf.py
:encoding:option. The encoding will not be inferred using the
-*- coding -*-metacomment.
Additionally, this directive supports all of the options of the
image directive, except for
target (since workflow will add its own target). These include
The workflow directive has the following configuration options:
workflow::file names are relative to. (If None or empty, file names are relative to the directory where the file containing the directive is.)
that determine the file format and the DPI. For entries whose DPI was omitted, sensible defaults are chosen. When passing from the command line through sphinx_build the list should be passed as suffix:dpi,suffix:dpi, ....
[(suffix, dpi), suffix, ...]
contextoption is not used in a workflow directive. This configuration option overrides this behavior and applies rcParams before each workflow.
sys.pathso it can import any helper modules sitting beside it. This configuration option can be used to specify a central directory (also added to
sys.path) where data files and helper modules for all code are located.