abtem.core.diagnostics#

Module Contents#

Classes#

TqdmWrapper

This class is a wrapper for the tqdm bar, which implements fallback logic if tqdm is not installed.

API#

class abtem.core.diagnostics.TqdmWrapper(...)[source]#

This class is a wrapper for the tqdm bar, which implements fallback logic if tqdm is not installed.

Initializes TqdmWrapper with user_tqdm flag, total iterations, and additional arguments for tqdm.

Parameters:
  • enabled (bool, optional) – A flag indicating if the wrapper is enabled. If None, the value from the configuration key “diagnostics.task_progress” is used.

  • *args – Variable length argument list for tqdm.

  • **kwargs – Arbitrary keyword arguments for tqdm.

Raises:

Warning – Issues a warning if the progress display is enabled but tqdm is not installed.

Initialization

close_if_exists() None[source]#

Closes the progress bar provided it exists.

property pbar#

The progress bar object.

update_if_exists(...) None[source]#

Updates the progress bar by n steps, if tqdm is successfully imported and enabled.

Parameters:

n (int, optional) – The number of steps by which to increment the progress bar.