pyphi.labels.NodeLabels#
- class pyphi.labels.NodeLabels(labels, node_indices)[source]#
-
Text labels for nodes in a substrate.
Labels can either be instantiated as a tuple of strings:
>>> NodeLabels(('A', 'IN'), (0, 1)) NodeLabels(('A', 'IN'))
Or, if all labels are a single character, as a string:
>>> NodeLabels('AB', (0, 1)) NodeLabels(('A', 'B'))
- coerce_to_indices(nodes)[source]#
Return the node indices for
nodes, which may be given either as integer indices or as node labels.
- coerce_to_labels(nodes)[source]#
Return the node labels for
nodes, which may be given either as labels or as integer indices.