Add 'fixed' option to fix the position of progress bars - #615
Open
mingrammer wants to merge 1 commit into
Open
Conversation
Codecov Report
@@ 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 |
Contributor
|
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. |
Author
|
@chengs There seems no error in travis-ci |
Contributor
|
@mingrammer Ah, that's because I rerun the test in travis-ci. :-) |
Author
|
@chengs Ah, that's good! Thank you :) |
Author
|
Any progress? |
casperdcl
force-pushed
the
master
branch
3 times, most recently
from
June 9, 2026 13:22
a09a105 to
4b33952
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I've added
fixedoption to fix the position of progress bars. I think it is useful to make the position of multiple bars fixed while using multiprocessing.With
fixedoption, 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.leave=True(default) and usingpositionwith tqdm(total=srcr.dbsize(), ascii=True, unit='keys', unit_scale=True, position=pos) as pbar: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.
leave=Falseand usingpositionwith tqdm(total=srcr.dbsize(), leave=False, ascii=True, unit='keys', unit_scale=True, position=pos) as pbar: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.fixed=Trueand usingpositionwith tqdm(total=srcr.dbsize(), fixed=True, ascii=True, unit='keys', unit_scale=True, position=pos) as pbar:With
fixed=True, I could see completed outputs which were not disappeared.fixedoption is very simillar toleave=Fasleexcept that it does not "clear" the completed progress bar (at__exit()__).