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

no progress printed for lengths 1 or 2 #258

Open
CarloLucibello opened this issue Feb 18, 2023 · 3 comments · May be fixed by #261
Open

no progress printed for lengths 1 or 2 #258

CarloLucibello opened this issue Feb 18, 2023 · 3 comments · May be fixed by #261

Comments

@CarloLucibello
Copy link

When the length of the iterator is 1 or 2 the progress bar is not printed at all:

julia>  @showprogress for i in 1:1; sleep(1) ; end

julia>  @showprogress for i in 1:2; sleep(1) ; end

julia>  @showprogress for i in 1:3; sleep(1) ; end
Progress: 100%|██████████████████████████| Time: 0:00:03

For consistency, I think that a progress bar should be printed in any case at the end of the loop no matter what the length of the iterator is and also no matter how large/small the dt option in the progress bar is.

@timholy
Copy link
Owner

timholy commented Feb 20, 2023

There's a minimum amount of time that must elapse before the progress bar is printed. This is deliberate, to avoid a performance hit in cases where the progress bar doesn't serve any real utility.

@CarloLucibello
Copy link
Author

CarloLucibello commented Feb 20, 2023

Can that be made customizable? I'm writing a deep learning library and I need it for consistency of the visual experience + some metrics are printed by the progress bar

@timholy
Copy link
Owner

timholy commented Feb 20, 2023

It already is. But it's possible there's a bug (I'm not seeing output even with @showprogress 0.1 for i = 1:2...). Should be an easy fix, care to take a look?

@CarloLucibello CarloLucibello linked a pull request Mar 7, 2023 that will close this issue
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

Successfully merging a pull request may close this issue.

2 participants