Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tqdm.std: add update_to #1540

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

tqdm.std: add update_to #1540

wants to merge 1 commit into from

Commits on Dec 25, 2023

  1. tqdm.std: add update_to

    Porting from dvc's Tqdm progress bar implementation.
    
    https://github.com/iterative/dvc/blob/cf8195c829aa67425b87e4145bd33cae8584ee1e/dvc/progress.py#L114-L117
    
    So, the implementation uses `self.update()` so that it refreshes based on `self.update()` logic.
    Also, adds a way to update `total`.
    
    This function is pretty convenient and useful even outside dvc. Take an example of fsspec's callback
    that uses both `total` and `value` (i.e. current position) at once.
    
    https://github.com/fsspec/filesystem_spec/blob/0ffe06cb767456b7c13904b57ec1c3ca60d53eae/fsspec/callbacks.py#L228
    
    I see that there are mentions of `update_to` in docs and examples, which will likely have to change
    as a result of this PR. So I'm happy to rename this to something else (eg: `set_position` etc.).
    
    Related: tqdm#1264.
    skshetry committed Dec 25, 2023
    Configuration menu
    Copy the full SHA
    25bd7b5 View commit details
    Browse the repository at this point in the history