Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions grandiso/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,7 @@ def find_motifs_iter(
is_node_structural_match=_is_node_structural_match,
is_node_attr_match=_is_node_attr_match,
is_edge_attr_match=_is_edge_attr_match,
best_match=[None],
) -> Generator[dict, None, None]:
"""
Yield mappings from motif node IDs to host graph IDs.
Expand Down Expand Up @@ -404,6 +405,10 @@ def find_motifs_iter(

# Graph path traversal function
def walk(path):

if best_match[0] is None or len(best_match[0]) < len(path):
best_match[0] = dict(path)

if path and len(path) == len(motif):
# Path complete
yield path
Expand Down