Skip to content

Commit

Permalink
Workaround for issue #820 (caching mechanism incompatible with DFS).
Browse files Browse the repository at this point in the history
  • Loading branch information
kysrpex committed Dec 6, 2022
1 parent 3d1f77a commit 05da951
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions simphony_osp/tools/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,14 @@ def _iter(
yield root

if current_depth < max_depth:
for sub in chain(
# Originally, this function was using DFS (no `list`), but it is
# incompatible with the caching mechanism. See issue #820.
# TODO: Fix
# [issue #820](https://github.com/simphony/simphony-osp/issues/820).
for sub in list(chain(
*(root.iter(rel=r) for r in rel),
*(root.annotations_iter(rel=r) for r in annotation)
):
)):
if sub.uid not in visited:
yield from _iter(
criterion=criterion,
Expand Down

0 comments on commit 05da951

Please sign in to comment.