alive-progress icon indicating copy to clipboard operation
alive-progress copied to clipboard

Reset ongoing bar (quantifying mode)

Open CharlieCheckpt opened this issue 3 years ago • 11 comments

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

CharlieCheckpt avatar Oct 05 '20 06:10 CharlieCheckpt

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 avatar Oct 05 '20 07:10 rsalmei

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?

rsalmei avatar Oct 05 '20 07:10 rsalmei

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.

CharlieCheckpt avatar Oct 05 '20 09:10 CharlieCheckpt

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

mxrch avatar Jan 23 '22 01:01 mxrch

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

rsalmei avatar Jan 24 '22 01:01 rsalmei

@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... 😓

rsalmei avatar Jan 31 '22 19:01 rsalmei

@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 ! 😊

mxrch avatar Jan 31 '22 20:01 mxrch

You're welcome! 👍

rsalmei avatar Jan 31 '22 20:01 rsalmei

@rsalmei Thank you it works very well !

mxrch avatar Feb 26 '22 14:02 mxrch

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.

TheTechRobo avatar Feb 26 '22 14:02 TheTechRobo

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

mxrch avatar Feb 26 '22 14:02 mxrch