247247import numpy as np
248248import logging
249249from ..due import due , Doi
250- from .base import AnalysisBase
250+ from .base import AnalysisBase , ProgressBar
251251from ..core import groups
252- from tqdm import tqdm
253252import collections
254253
255254logger = logging .getLogger ("MDAnalysis.analysis.msd" )
@@ -416,7 +415,11 @@ def _conclude_simple(self):
416415 r"""Calculates the MSD via the simple "windowed" algorithm."""
417416 lagtimes = np .arange (1 , self .n_frames )
418417 positions = self ._position_array .astype (np .float64 )
419- for lag in tqdm (lagtimes ):
418+ for lag in ProgressBar (
419+ lagtimes ,
420+ verbose = self ._verbose ,
421+ desc = "Calculating MSD for lagtimes" ,
422+ ):
420423 disp = positions [:- lag , :, :] - positions [lag :, :, :]
421424 sqdist = np .square (disp ).sum (axis = - 1 )
422425 self .results .msds_by_particle [lag , :] = np .mean (sqdist , axis = 0 )
@@ -443,7 +446,11 @@ def _conclude_fft(self): # with FFT, np.float64 bit prescision required.
443446 )
444447
445448 positions = self ._position_array .astype (np .float64 )
446- for n in tqdm (range (self .n_particles )):
449+ for n in ProgressBar (
450+ range (self .n_particles ),
451+ verbose = self ._verbose ,
452+ desc = "Calculating MSD with FFT per particle" ,
453+ ):
447454 self .results .msds_by_particle [:, n ] = tidynamics .msd (
448455 positions [:, n , :]
449456 )
0 commit comments