swansonk14 / p_tqdm

Parallel processing with progress bars
MIT License
457 stars 44 forks source link

Support tqdm(..., desc='Put description here') #5

Closed theHamsta closed 4 years ago

theHamsta commented 5 years ago

Thanks for writing this awesome library!

It would be nice if the desc argument of tqdm would be propagated when using p_tqdm.p_map(..., desc='My awesome parallel task') to the internal call of tqdm.

swansonk14 commented 4 years ago

Thank you! And thank you for the suggestion! This functionality is now covered by https://github.com/swansonk14/p_tqdm/pull/2, which allows any kwargs to be passed to the tqdm object.

ahmedbesbes commented 3 years ago

Hello! Thanks for the great package and this feature. I was wondering if the description could be updated dynamically? I'm trying to change its value (to reflect the number of scraped items so far )but the description is stuck at the initial value. thanks

Here's what I've tried so far:


all_posts = []
all_tags = []
n = 0

progress_bar = p_uimap(
    extract_page, days, **{"num_cpus": args.num_cpus, "desc": f"n = {n}"},
)

for posts_by_page, tags_by_page in progress_bar:
    all_posts += posts_by_page
    all_tags += tags_by_page

    n += len(all_posts)