diff --git a/src/aspire/abinitio/commonline_base.py b/src/aspire/abinitio/commonline_base.py index c33a63cec1..e3d8fa50db 100644 --- a/src/aspire/abinitio/commonline_base.py +++ b/src/aspire/abinitio/commonline_base.py @@ -5,7 +5,7 @@ import scipy.sparse as sparse from aspire.operators import PolarFT -from aspire.utils import common_line_from_rots, fuzzy_mask +from aspire.utils import common_line_from_rots, fuzzy_mask, tqdm from aspire.utils.random import choice logger = logging.getLogger(__name__) @@ -167,6 +167,10 @@ def build_clmatrix(self): # Note that only use half of each ray pf = self._apply_filter_and_norm("ijk, k -> ijk", pf, r_max, h) + # Setup a progress bar + _total_pairs_to_test = self.n_img * (self.n_check - 1) // 2 + pbar = tqdm(desc="Searching over common line pairs", total=_total_pairs_to_test) + # Search for common lines between [i, j] pairs of images. # Creating pf and building common lines are different to the Matlab version. # The random selection is implemented. @@ -211,6 +215,8 @@ def build_clmatrix(self): clmatrix[j, i] = cl2 cl_dist[i, j] = sval shifts_1d[i, j] = shifts[shift] + pbar.update() + pbar.close() self.clmatrix = clmatrix self.shifts_1d = shifts_1d diff --git a/src/aspire/reconstruction/estimator.py b/src/aspire/reconstruction/estimator.py index e002b7c3da..679b3e1234 100644 --- a/src/aspire/reconstruction/estimator.py +++ b/src/aspire/reconstruction/estimator.py @@ -51,7 +51,7 @@ def __init__( self.src = src if basis is None: - logger.info("{self.__class__.__name__} instantiating default basis.") + logger.info(f"{self.__class__.__name__} instantiating default basis.") basis = FFBBasis3D(src.L, dtype=src.dtype) self.basis = basis self.dtype = self.src.dtype