opto.trace.nodes.Graph.get

Contents

opto.trace.nodes.Graph.get#

Graph.get(name)[source]#

Retrieve a node from the graph by its name.

Parameters:

name (str) – A string in the format “name:id”, where “name” is the name of the node and “id” is the identifier of the node.

Returns:

The requested node from the graph.

Return type:

Node

Notes

Ensure that the ‘name’ parameter is correctly formatted as “name:id” before calling this function. The function assumes that the ‘_nodes’ attribute is a dictionary where each key is a node name and the corresponding value is a list of nodes. The ‘id’ should be a valid index within the list of nodes for the given ‘name’.