ProgressBar
- class mdtools.run_time_info.ProgressBar(*_, **__)[source]
Display a visual progress bar and time estimate.
The
ProgressBardecorates an iterable object, returning an iterator which acts exactly like the original iterable, but prints a dynamically updating progress bar every time a value is requested.See also
MDAnalysis.lib.log.ProgressBarParent class
tqdm.auto.tqdmGrandparent class
Notes
This class is derived from
MDAnalysis.lib.log.ProgressBar, which in turn is derived fromtqdm.auto.tqdm. The only difference totqdm.auto.tqdmis that some default arguments are changed:ascii is set to
True.unit is set to
'frames'.unit_scale is set to
True.The bar_format is changed to switch off a possible inversion of ‘unit/s’ to ‘s/unit’ (see also https://github.com/tqdm/tqdm/issues/72).
mininterval is set to
300seconds.maxinterval is set to
3600seconds.
See the MDAnalysis and tqdm documentations for further information.
Example
for ts in mdt.rti.ProgressBar(u.trajectory): # Perform analysis
will produce something similar to:
25%|#####1 | 25/100 [00:15<00:45, 1.67frames/s]
Initialize the
ProgressBar.- Parameters:
args (
list, optional) – Positional arguments. SeeMDAnalysis.lib.log.ProgressBarfor possible choices.kwargs (
dict, optional) – Keyword arguments. SeeMDAnalysis.lib.log.ProgressBarfor possible choices.
Methods
as_completedWrapper for asyncio.as_completed.
clearClear current bar display.
closeCleanup and (if leave=False) close the progressbar.
displayUse self.sp to display msg in the specified pos.
external_write_modeDisable tqdm within context and refresh tqdm when exits.
format_intervalFormats a number of seconds as a clock time, [H:]MM:SS
format_meterReturn a string-based progress bar given some parameters
format_numIntelligent scientific notation (.3g).
format_sizeofFormats a number (greater than unity) with SI Order of Magnitude prefixes.
gatherWrapper for asyncio.gather.
get_lockGet the global lock.
movetopandasRegisters the current tqdm class with
refreshForce refresh the display of this bar.
resetResets to 0 iterations for repeated use.
sendset_descriptionSet/modify description of the progress bar.
set_description_strSet/modify description without ': ' appended.
set_lockSet the global lock.
set_postfixSet/modify postfix (additional stats) with automatic formatting based on datatype.
set_postfix_strPostfix without dictionary expansion, similar to prefix handling.
status_printerManage the printing and in-place updating of a line of characters.
unpauseRestart tqdm timer from last print time.
updateManually update the progress bar, useful for streams such as reading files.
wrapattrstream : file-like object. method : str, "read" or "write". The result of read() and the first argument of write() should have a len().
writePrint a message via tqdm (without overlap with bars).
Attributes
format_dictPublic API for read-only member access.
monitormonitor_interval