Progress
Warning
This module is deprecated and will be removed in a future release.
It implements a wrapper for the tqdm progress bar
iterator for easy toggling, but this functionality is already provided by
the disable
argument of tqdm
.
MockProgress(iterator)
¶
Bases: Iterator
A Naive mock class to use with maybe_progress and tqdm. Mocked methods don't support return values. Mocked properties don't do anything
Source code in src/pydvl/utils/progress.py
maybe_progress(it, display=False, **kwargs)
¶
Returns either a tqdm progress bar or a mock object which wraps the iterator as well, but ignores any accesses to methods or properties.
PARAMETER | DESCRIPTION |
---|---|
it |
the iterator to wrap |
display |
set to True to return a tqdm bar
TYPE:
|
kwargs |
Keyword arguments that will be forwarded to tqdm
DEFAULT:
|
Source code in src/pydvl/utils/progress.py
Created: 2023-09-02