as_topology_graph#
- class braintools.visualize.morphology.as_topology_graph(obj)[source]#
Return
objasTopologyGraph.- Parameters:
obj (
Any) – The graph itself, or an object whose__topology_data__()method returns it (for example a simulator’s solver-node tree).- Raises:
TypeError – If
objis neither, or its__topology_data__()does not returnTopologyGraph.- Return type:
Examples
>>> from braintools.visualize.morphology import TopologyGraph, as_topology_graph >>> graph = TopologyGraph(node_ids=(0, 1), edges=((0, 1),), root_id=0) >>> as_topology_graph(graph) is graph True