Skip to content

Commit

Permalink
Bugfix: lift limit for internal calls
Browse files Browse the repository at this point in the history
  • Loading branch information
arie-matsliah authored and rmorey committed Jul 14, 2023
1 parent 5f9de89 commit c87722c
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/service/motif_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ def _search_pairs(
],
)
)
if len(matches) >= limit:
if limit and len(matches) >= limit:
break
elif xy_edge_constraints:
for xy, xy_edge_matches in xy_satisfied_connections.items():
Expand All @@ -398,7 +398,7 @@ def _search_pairs(
],
)
)
if len(matches) >= limit:
if limit and len(matches) >= limit:
break
elif yx_edge_constraints:
for yx, yx_edge_matches in yx_satisfied_connections.items():
Expand All @@ -412,7 +412,7 @@ def _search_pairs(
],
)
)
if len(matches) >= limit:
if limit and len(matches) >= limit:
break
else:
# no edge constraints - return all pairs
Expand All @@ -423,7 +423,7 @@ def _search_pairs(
neuron_db=neuron_db, nodes=[(x, xc), (y, yc)], edges=[]
)
)
if len(matches) >= limit:
if limit and len(matches) >= limit:
break

return matches
Expand Down Expand Up @@ -462,7 +462,7 @@ def _search_triplets(
y_candidates=y_candidates,
xy_edge_constraints=xy_edge_constraints,
yx_edge_constraints=yx_edge_constraints,
limit=limit,
limit=None,
)
xz_pairs = MotifSearchQuery._search_pairs(
neuron_db,
Expand All @@ -472,7 +472,7 @@ def _search_triplets(
y_candidates=z_candidates,
xy_edge_constraints=xz_edge_constraints,
yx_edge_constraints=zx_edge_constraints,
limit=limit,
limit=None,
)
yz_pairs = MotifSearchQuery._search_pairs(
neuron_db,
Expand All @@ -482,7 +482,7 @@ def _search_triplets(
y_candidates=z_candidates,
xy_edge_constraints=yz_edge_constraints,
yx_edge_constraints=zy_edge_constraints,
limit=limit,
limit=None,
)

x_ids_for_z_id = {z_id: set() for z_id in z_candidates}
Expand Down

0 comments on commit c87722c

Please sign in to comment.