From a48093f9a9b8bc398bc9b94f3dba4519be9dc31d Mon Sep 17 00:00:00 2001 From: Steven Zeltmann Date: Thu, 5 Oct 2023 09:23:51 -0400 Subject: [PATCH] move progress update step --- py4DSTEM/process/diffraction/crystal_ACOM.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/py4DSTEM/process/diffraction/crystal_ACOM.py b/py4DSTEM/process/diffraction/crystal_ACOM.py index 115f8140c..da553456f 100644 --- a/py4DSTEM/process/diffraction/crystal_ACOM.py +++ b/py4DSTEM/process/diffraction/crystal_ACOM.py @@ -1826,10 +1826,6 @@ def cluster_grains( search = False else: - new_marks = mark_total - np.sum(np.max(mark, axis=2)) - pbar.update(new_marks) - mark_total -= new_marks - # Start cluster x, y, z = np.unravel_index(inds_grain, sig.shape) mark[x, y, z] = False @@ -1909,6 +1905,11 @@ def cluster_grains( self.cluster_orientation.append(orientation_cluster) self.cluster_inds.append(xyg) + # update progressbar + new_marks = mark_total - np.sum(np.max(mark, axis=2)) + pbar.update(new_marks) + mark_total -= new_marks + pbar.close()