Skip to content

Commit 7f27776

Browse files
Add function to get routes by signal names
1 parent b961e64 commit 7f27776

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

yaramo/topology.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,12 @@ def get_edge_by_nodes(self, node_a: Node, node_b: Node):
5050
return edge
5151
return None
5252

53+
def get_route_by_signal_names(self, start_signal_name, end_signal_name):
54+
for route_uuid in self.routes:
55+
route = self.routes[route_uuid]
56+
if route.start_signal.name == start_signal_name and route.end_signal.name == end_signal_name:
57+
return route
58+
5359
def to_serializable(self):
5460
"""See the description in the BaseElement class.
5561

0 commit comments

Comments
 (0)