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

Reset ongoing bar (quantifying mode) #59

Open
CharlieCheckpt opened this issue Oct 5, 2020 · 11 comments
Open

Reset ongoing bar (quantifying mode) #59

CharlieCheckpt opened this issue Oct 5, 2020 · 11 comments
Labels
feature request No promises...

Comments

@CharlieCheckpt
Copy link

Hello,

Thank you for this package, animations are really cool.

I would like to display several times progress bar, and clear the previous progress bar before starting the new one.
It seems not possible to clear a progress bar once it's finished or did I miss something ?

for epoch in range(10):
    with alive_bar(100, bar="blocks", title=f"[Epoch: {epoch}]") as bar:
        for i in range(100):
            time.sleep(0.01)
            bar()

image

Thanks

@rsalmei
Copy link
Owner

rsalmei commented Oct 5, 2020

Hello @CharlieCheckpt, thank you man! I'm glad you liked them!

I didn't quite get it, you are asking how to "clear the previous progress bar". Does that mean you'd like to see the line entirely cleared, so as skipping a line, then running the new progress bar and skipping its line again, and ending up with 10 blank lines?
If it is, it really is not possible, I always put a receipt at the end, to mark that processing as finished, and see its stats like count, elapsed time and throughput.

I have another feature implemented, but not yet released, that will enable you to reset an ongoing bar, I think that is what you really wanted, right? That way, all bars would be rendered in the same line, with new titles and progresses and stats!
It is in a stash for now, I need to finalize #51 before thinking of returning to it. But should be soon, stay tuned! 👍

@rsalmei
Copy link
Owner

rsalmei commented Oct 5, 2020

This even gives me an idea... If someone really does want to use the future reset() like that, with several different processings happening, it would be weird to print the final receipt with only the last data. Maybe in addition to it, there could be a memory(), to reset but remember internally what did happen, so the final print receipt could include all the data of all the processings!
Do you think that could be useful?

@CharlieCheckpt
Copy link
Author

Thank you for this quick answer @rsalmei !

You're right, I was thinking actually of resetting an ongoing bar. That's great if you already thought about it :)

For what I am specifically doing, only getting receipt of last data is okay. I am logging training metrics at each step with mlflow, so I can visualize the metrics history in a separate window. But having a memory() feature could definitely be useful to visualize metrics history directly in the terminal. I am sure there are other tasks where this would be very relevant.

@rsalmei rsalmei changed the title Clear bar once it's done Clear bar once it's done (quantifying mode) Oct 6, 2020
@rsalmei rsalmei added the feature request No promises... label Oct 15, 2020
@rsalmei rsalmei added this to the 2.1 milestone Oct 15, 2020
@mxrch
Copy link

mxrch commented Jan 23, 2022

Hello, up ! :)
Isn't there now a simple way to delete the progress bar once it's finished ?

@rsalmei
Copy link
Owner

rsalmei commented Jan 24, 2022

What do you mean? I didn't quite get it.

@rsalmei rsalmei modified the milestones: 2.1, 2.2 Jan 30, 2022
@rsalmei
Copy link
Owner

rsalmei commented Jan 31, 2022

@mxrch If you meant not to print the final receipt once the processing is finished, this is done!
Should be released today.

Quantifying mode is still on that stash... 😓

@mxrch
Copy link

mxrch commented Jan 31, 2022

@mxrch If you meant not to print the final receipt once the processing is finished, this is done!
Should be released today.

Quantifying mode is still on that stash... 😓

It was exactly what I meant, thank you very much for your work ! 😊

@rsalmei
Copy link
Owner

rsalmei commented Jan 31, 2022

You're welcome! 👍

@mxrch
Copy link

mxrch commented Feb 26, 2022

@rsalmei Thank you it works very well !

@TheTechRobo
Copy link
Contributor

I don't think that quantifying mode has been implemented. The thing you want has, but just because you have gotten your answer doesn't mean the issue author's feature request is finished.

@mxrch
Copy link

mxrch commented Feb 26, 2022

@TheTechRobo Yes, I didn't see that quantifying mode is not done yet. :)

@rsalmei rsalmei changed the title Clear bar once it's done (quantifying mode) Reset ongoing bar (quantifying mode) Sep 27, 2023
@rsalmei rsalmei removed this from the 2.2 milestone Jan 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request No promises...
Projects
None yet
Development

No branches or pull requests

4 participants