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

Add 'fixed' option to fix the position of progress bars #615

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

Conversation

@mingrammer
Copy link

@mingrammer mingrammer commented Sep 17, 2018

I've added fixed option to fix the position of progress bars. I think it is useful to make the position of multiple bars fixed while using multiprocessing.

With fixed option, you can fix the position of progress bars and make the bars keeping on its position even though a process was completed.

Real case

I wanted to run 8 jobs with 3 processes with multiprocessing. As you know, an order of job running is unexpectable, so it may be challenging to keep the progress bars for each job on its fixed positions.

  1. leave=True (default) and using position

with tqdm(total=srcr.dbsize(), ascii=True, unit='keys', unit_scale=True, position=pos) as pbar:

screenshot 2018-09-17 20 05 24

Yes it is tracing option, so, unexpected process switching are all traced. So I can't fix progress bars on a single line for a process.

  1. leave=False and using position

with tqdm(total=srcr.dbsize(), leave=False, ascii=True, unit='keys', unit_scale=True, position=pos) as pbar:

screenshot 2018-09-17 20 05 45

With leave=False, each progress bar will be updated on its (fixed) position. But, when a progress is completed, bars will be disappeared. So, I could not see completed output.

  1. fixed=True and using position

with tqdm(total=srcr.dbsize(), fixed=True, ascii=True, unit='keys', unit_scale=True, position=pos) as pbar:

screenshot 2018-09-17 20 42 40

With fixed=True, I could see completed outputs which were not disappeared.fixed option is very simillar to leave=Fasle except that it does not "clear" the completed progress bar (at __exit()__).

@codecov-io
Copy link

@codecov-io codecov-io commented Sep 17, 2018

Codecov Report

Merging #615 into master will decrease coverage by 0.41%.
The diff coverage is 57.14%.

@@            Coverage Diff             @@
##           master     #615      +/-   ##
==========================================
- Coverage   98.87%   98.45%   -0.42%     
==========================================
  Files           9        9              
  Lines         709      713       +4     
  Branches      127      129       +2     
==========================================
+ Hits          701      702       +1     
- Misses          5        6       +1     
- Partials        3        5       +2

@chengs
Copy link
Contributor

@chengs chengs commented Sep 17, 2018

I help you fix the error in travis-ci. If you find the perf test reports an error, try to rerun it in travis-ci. Sometimes it happens.

As to the decision of whether use this PR, let's wait @casperdcl to make it.

@mingrammer
Copy link
Author

@mingrammer mingrammer commented Sep 17, 2018

@chengs There seems no error in travis-ci

@chengs
Copy link
Contributor

@chengs chengs commented Sep 17, 2018

@mingrammer Ah, that's because I rerun the test in travis-ci. :-)

@mingrammer
Copy link
Author

@mingrammer mingrammer commented Sep 17, 2018

@chengs Ah, that's good! Thank you :)

@mingrammer
Copy link
Author

@mingrammer mingrammer commented Jan 1, 2021

Any progress?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants