Provides tools for visualization of the provenance graph.
aiida.tools.visualization.
Graph
Bases: object
object
a class to create graphviz graphs of the AiiDA node provenance
__dict__
__init__
Nodes and edges, are cached, so that they are only created once
engine (str or None) – the graphviz engine, e.g. dot, circo (Default value = None)
graph_attr (dict or None) – attributes for the graphviz graph (Default value = None)
global_node_style (dict or None) – styles which will be added to all nodes. Note this will override any builtin attributes (Default value = None)
global_edge_style (dict or None) – styles which will be added to all edges. Note this will override any builtin attributes (Default value = None)
include_sublabels (bool) – if True, the note text will include node dependant sub-labels (Default value = True)
link_style_fn – callable mapping LinkType to graphviz style dict; link_style_fn(link_type) -> dict (Default value = None)
node_sublabel_fn – callable mapping nodes to a graphviz style dict; node_sublabel_fn(node) -> dict (Default value = None)
node_sublabel_fn – callable mapping data node to a sublabel (e.g. specifying some attribute values) node_sublabel_fn(node) -> str (Default value = None)
node_id_type (str) – the type of identifier to within the node text (‘pk’, ‘uuid’ or ‘label’)
__module__
__weakref__
list of weak references to the object (if defined)
_convert_link_types
convert link types, which may be strings, to a member of LinkType
_default_link_types
If link_types is empty, it will return all the links_types
links – iterable with the link_types ()
list of aiida.common.links.LinkType
aiida.common.links.LinkType
_load_node
load a node (if not already loaded)
node (int or str or aiida.orm.nodes.node.Node) – node or node pk/uuid
aiida.orm.nodes.node.Node
add_edge
add single node to the graph
in_node (int or aiida.orm.nodes.node.Node) – node or node pk/uuid
out_node (int or str or aiida.orm.nodes.node.Node) – node or node pk/uuid
link_pair (None or aiida.orm.utils.links.LinkPair) – defining the relationship between the nodes
style (dict or None) – graphviz style parameters (Default value = None)
overwrite (bool) – whether to overrite existing edge (Default value = False)
add_incoming
add nodes and edges for incoming links to a node
node (aiida.orm.nodes.node.Node or int) – node or node pk/uuid
link_types (str or tuple[str] or aiida.common.links.LinkType or tuple[aiida.common.links.LinkType]) – filter by link types (Default value = ())
annotate_links (bool or str) – label edges with the link ‘label’, ‘type’ or ‘both’ (Default value = None)
return_pks (bool) – whether to return a list of nodes, or list of node pks (Default value = True)
list of nodes or node pks
add_node
style_override (dict or None) – graphviz style parameters that will override default values
overwrite (bool) – whether to overrite an existing node (Default value = False)
add_origin_to_targets
Add nodes and edges from an origin node to all nodes of a target node class.
origin (aiida.orm.nodes.node.Node or int) – node or node pk/uuid
target_cls – target node class
target_filters (dict or None) – (Default value = None)
include_target_inputs (bool) – (Default value = False)
include_target_outputs (bool) – (Default value = False)
origin_style (dict or tuple) – node style map for origin node (Default value = ())
annotate_links (bool) – label edges with the link ‘label’, ‘type’ or ‘both’ (Default value = False)
add_origins_to_targets
Add nodes and edges from all nodes of an origin class to all node of a target node class.
origin_cls – origin node class
origin_filters (dict or None) – (Default value = None)
add_outgoing
add nodes and edges for outgoing links to a node
node (aiida.orm.nodes.node.Node or int) – node or node pk
edges
return a copy of the edges
graphviz
return a copy of the graphviz.Digraph
nodes
return a copy of the nodes
recurse_ancestors
add nodes and edges from an origin recursively, following incoming links
depth (None or int) – if not None, stop after travelling a certain depth into the graph (Default value = None)
link_types (tuple or str) – filter by subset of link types (Default value = ())
origin_style (None or dict) – node style map for origin node (Default value = None)
include_process_outputs (bool) – include outgoing links for all processes (Default value = False)
highlight_classes – class label (as displayed in the graph, e.g. ‘StructureData’, ‘FolderData’, etc.) to be highlight and other nodes are decolorized (Default value = None)
print_func – a function to stream information to, i.e. print_func(str)
list or tuple of str
Deprecated since version 1.1.0: print_func will be removed in v2.0.0
recurse_descendants
add nodes and edges from an origin recursively, following outgoing links
annotate_links (bool or str) – label edges with the link ‘label’, ‘type’ or ‘both’ (Default value = False)
include_calculation_inputs (bool) – include incoming links for all processes (Default value = False)
highlight_classes – target class in exported graph expected to be highlight and other nodes are decolorized (Default value = None)
print_func – a function to stream information to, i.e. print_func(str) (this feature is deprecated since v1.1.0 and will be removed in v2.0.0)
tuple of class or class
default_link_styles
map link_pair to a graphviz edge style
link_type (aiida.orm.utils.links.LinkPair) – a LinkPair attribute
add_label (bool) – include link label
add_type (bool) – include link type
dict
default_node_styles
map a node to a graphviz node style
node (aiida.orm.nodes.node.Node) – the node to map
default_node_sublabels
function mapping nodes to a sublabel (e.g. specifying some attribute values)
str
pstate_node_styles
map a process node to a graphviz node style
provides functionality to create graphs of the AiiDa data providence, via graphviz.
aiida.tools.visualization.graph.
__annotations__