Skip to content

Commit 00ec82a

Browse files
authored
Extending path matching logic with regular expressions. Leveraging it in CapacityProbe and other places. (#51)
1 parent ae885a2 commit 00ec82a

7 files changed

Lines changed: 838 additions & 203 deletions

File tree

ngraph/blueprints.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,8 +231,11 @@ def _expand_adjacency_pattern(
231231
wrap-around if one side is an integer multiple of the other.
232232
Also skips self-loops.
233233
"""
234-
source_nodes = ctx.network.select_nodes_by_path(source_path)
235-
target_nodes = ctx.network.select_nodes_by_path(target_path)
234+
source_node_groups = ctx.network.select_node_groups_by_path(source_path)
235+
target_node_groups = ctx.network.select_node_groups_by_path(target_path)
236+
237+
source_nodes = [node for _, nodes in source_node_groups.items() for node in nodes]
238+
target_nodes = [node for _, nodes in target_node_groups.items() for node in nodes]
236239

237240
if not source_nodes or not target_nodes:
238241
return

0 commit comments

Comments
 (0)