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

[JupyterLab] tqdm.auto visual output bug 4.49.0 #1031

Closed
1 of 8 tasks
vfdev-5 opened this issue Sep 13, 2020 · 3 comments · Fixed by #1032 or #1041
Closed
1 of 8 tasks

[JupyterLab] tqdm.auto visual output bug 4.49.0 #1031

vfdev-5 opened this issue Sep 13, 2020 · 3 comments · Fixed by #1032 or #1041
Assignees
Labels
p2-bug-warning ⚠ Visual output bad question/docs ‽ Documentation clarification candidate submodule-notebook 📓 Much web such IDE to-merge ↰ Imminent
Projects
Milestone

Comments

@vfdev-5
Copy link

vfdev-5 commented Sep 13, 2020

Visual output bug since the new 4.49.0 release with jupyter lab:

from tqdm.auto import tqdm
import tqdm as t
print(t.__version__)
import time

pbar = tqdm(
    total=None, 
    leave=False, 
    bar_format="{desc}[{n_fmt}/{total_fmt}] {percentage:3.0f}%|{bar}{postfix} [{elapsed}<{remaining}]", 
    initial=1,
    desc="Iterations"
)

for _ in range(10):
    time.sleep(0.5)
    pbar.update(1)    
    
pbar.close()

gives

Screen Shot 2020-09-13 at 21 06 20

When I remove bar_format visual output looks better.

  • I have marked all applicable categories:
    • exception-raising bug
    • visual output bug
    • documentation request (i.e. "X is missing from the documentation." If instead I want to ask "how to use X?" I understand StackOverflow#tqdm is more appropriate)
    • new feature request
  • I have visited the source website, and in particular
    read the known issues
  • I have searched through the issue tracker for duplicates
  • I have mentioned version numbers, operating system and
    environment, where applicable:
    import tqdm, sys
    print(tqdm.__version__, sys.version, sys.platform)

4.49.0 3.7.7 (default, Mar 23 2020, 22:36:06)
[GCC 7.3.0] linux

@casperdcl
Copy link
Sponsor Member

casperdcl commented Sep 13, 2020

Can you confirm this is also the case with tqdm==4.48.2? (I think tqdm<=4.48.0 has your desired behaviour).

In all versions this should work though:

 import time

 pbar = tqdm(
-     total=None,
+     total=10,
     leave=False,
     bar_format="{desc}[{n_fmt}/{total_fmt}] {percentage:3.0f}%|{bar}{postfix} [{elapsed}<{remaining}]",

@casperdcl casperdcl self-assigned this Sep 13, 2020
@casperdcl casperdcl added question/docs ‽ Documentation clarification candidate submodule-notebook 📓 Much web such IDE labels Sep 13, 2020
@casperdcl casperdcl added this to In Progress in Casper Sep 13, 2020
@casperdcl casperdcl added need-feedback 📢 We need your response (question) p2-bug-warning ⚠ Visual output bad labels Sep 13, 2020
casperdcl added a commit that referenced this issue Sep 13, 2020
@casperdcl
Copy link
Sponsor Member

@vfdev-5 lemme know if #1032 fixes your issue.

@casperdcl casperdcl moved this from In Progress to Next Release in Casper Sep 13, 2020
@casperdcl casperdcl added this to the Non-breaking milestone Sep 13, 2020
@casperdcl casperdcl linked a pull request Sep 13, 2020 that will close this issue
@vfdev-5
Copy link
Author

vfdev-5 commented Sep 14, 2020

@casperdcl thanks for working on the issue ! Yes, you are right the behaviour I'd like is the one with tqdm<=4.48.0.

I agree that if total is set, visual output is OK.

#1032 makes the visual output same as if I use 4.49.0 and remove bar_format (in my test). Ultimately, desired visual output is like the one with tqdm<=4.48.0.

@casperdcl casperdcl added to-merge ↰ Imminent and removed need-feedback 📢 We need your response (question) labels Sep 14, 2020
Casper automation moved this from Next Release to Done Sep 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p2-bug-warning ⚠ Visual output bad question/docs ‽ Documentation clarification candidate submodule-notebook 📓 Much web such IDE to-merge ↰ Imminent
Projects
Casper
  
Done
Development

Successfully merging a pull request may close this issue.

2 participants