Skip to content

Commit

Permalink
Scipy doesn't have callback so don't show progress.
Browse files Browse the repository at this point in the history
  • Loading branch information
matham committed May 23, 2024
1 parent e1ca972 commit fa70e65
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions brainglobe_utils/cells/cells.py
Original file line number Diff line number Diff line change
Expand Up @@ -513,15 +513,21 @@ def match_cells(
if flip:
c1, c2 = c2, c1

progress = tqdm(desc="Matching cells", total=len(c1), unit="cells")
__progress_update.updater = progress.update
progress = None
if not use_scipy:
# with scipy we don't have callbacks so no updates
progress = tqdm(desc="Matching cells", total=len(c1), unit="cells")
__progress_update.updater = progress.update

# for each index corresponding to c1, returns the index in c2 that matches
try:
assignment = match_points(c1, c2, threshold, pre_match, use_scipy)
progress.close()
finally:
__progress_update.updater = None

if progress is not None:
progress.close()

missing_c1, good_matches, missing_c2 = analyze_point_matches(
c1, c2, assignment, threshold
)
Expand Down

0 comments on commit fa70e65

Please sign in to comment.