zeehio / parmap

Easy to use map and starmap python equivalents
Apache License 2.0
144 stars 9 forks source link

Description and unit for the progress bar #28

Closed kaparoo closed 2 years ago

kaparoo commented 2 years ago

Is there a way to set the description or unit of the progress bar when pm_pbar is True?

If not, I think it is helpful to add keyword arguments like pm_pbar_desc, and pm_pbar_unit to support such features.

zeehio commented 2 years ago

I am sorry, I am not that familiar with progress bar options. I'm using the tqdm package. What would you expect the description and units do? Do you mean some text to be shown at the left and some postfix at the right of the progress bar? Or some other thing? An example (with a screenshot if possible) would be helpful.

Currently, if you want to process a list of 200 elements, the progress bar will have 200 steps, that will be filled as the elements are processed.

zeehio commented 2 years ago

If you are comfortable with tqdm.tqdm() options I could make it so pm_pbar can be a dictionary instead of just True and the contents of that dictionary will be appended to the tqdm.tqdm() call, so you can pass any options from https://tqdm.github.io/docs/tqdm/#__init__ (including desc and unit). Would that work for you?

kaparoo commented 2 years ago

If you are comfortable with tqdm.tqdm() options I could make it so pm_pbar can be a dictionary instead of just True and the contents of that dictionary will be appended to the tqdm.tqdm() call, so you can pass any options from https://tqdm.github.io/docs/tqdm/#__init__ (including desc and unit). Would that work for you?

That is what I really want! Making pm_pbar to be a dictionary would be more useful rather than just adding pm_pbar_desc or pm_pbar_unit. Thank you for your immediate and kind reply.

zeehio commented 2 years ago

Closed in #29

zeehio commented 2 years ago

Feel free to use parmap 1.6.0, already on pypi and soon on conda-forge

And thanks for the pull request!

kaparoo commented 2 years ago

Nice work! Thanks 😁