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

rich based progress part doesn't 'complete' cleanly #1266

Open
2 of 5 tasks
GordonMcGregor opened this issue Oct 23, 2021 · 4 comments
Open
2 of 5 tasks

rich based progress part doesn't 'complete' cleanly #1266

GordonMcGregor opened this issue Oct 23, 2021 · 4 comments

Comments

@GordonMcGregor
Copy link

  • I have marked all applicable categories:
    • exception-raising bug
    • visual output bug
  • I have visited the source website, and in particular
    read the known issues
  • [X ] 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)

$ python
import tqdm, sys
print(tqdm.version, sys.version, sys.platform)
Python 3.7.6 (default, Jan 8 2020, 13:42:34)
[Clang 4.0.1 (tags/RELEASE_401/final)] :: Anaconda, Inc. on darwin

When I run a simple test case, comparing rich.progress to tqdm.rich, tqdm rich doesn't print the 'final' result, stopping maybe one update short in most cases. You'll see the rich.progress bar reach and display 100%, but the TQDM case always stops at some iteration before 100% in the display (data is correct)

testcase is:
$ python3 -c "from tqdm.rich import tqdm;from rich.progress import track;a=[n for n in track(range(10000000))];b=[n for n in tqdm(range(10000000))];"

$ python3 -c "from tqdm.rich import tqdm;from rich.progress import track;a=[n for n in track(range(10000000))];b=[n for n in tqdm(range(10000000))];"
Working... ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 0:00:00
-c:1: TqdmExperimentalWarning: rich is experimental/alpha
95% ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╸━━━━ 9,474,605/10,000,000 [ 0:00:01 < 0:00:01 , 5,662,501 it/s ]
(base)

@GordonMcGregor
Copy link
Author

python3 -c "from tqdm.rich import tqdm;from rich.progress import track;a=[n for n in track(range(10000000))];b=[n for n in tqdm(range(10000000))];print(len(a), len(b))"

to confirm data sizes:

$ python3 -c "from tqdm.rich import tqdm;from rich.progress import track;a=[n for n in track(range(10000000))];b=[n for n in tqdm(range(10000000))];print(len(a), len(b))"
Working... ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 0:00:00
-c:1: TqdmExperimentalWarning: rich is experimental/alpha
96% ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╺━━ 9,628,533/10,000,000 [ 0:00:01 < 0:00:01 , 5,442,715 it/s ]
10000000 10000000

@glensc
Copy link
Contributor

glensc commented Nov 21, 2022

I think this is a duplicate of the same problem:

@glensc
Copy link
Contributor

glensc commented Nov 21, 2022

@GordonMcGregor what are your tqdm and rich versions?

@glensc
Copy link
Contributor

glensc commented May 3, 2024

#1395 merged, this can be closed

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

No branches or pull requests

2 participants