rasbt / pyprind

PyPrind - Python Progress Indicator Utility
BSD 3-Clause "New" or "Revised" License
547 stars 65 forks source link

Jupyter Notebook Output - ETA Repeated #37

Closed pmorissette closed 7 years ago

pmorissette commented 7 years ago

Hi,

First off, thanks for the nice library. I typically use pyprind within a Notebook (IPython/Jupyter). After updating to the latest version of Jupyter Notebook, I get some repeated ETA messages.

Here's an example:

import pyprind
import time

for i in pyprind.prog_bar(range(50), stream=1):
    time.sleep(0.1)

And here's the output:

0%                          100%
[##############################] | ETA: 00:00:04 | ETA: 00:00:04 | ETA: 00:00:04 | ETA: 00:00:04 | ETA: 00:00:04 | ETA: 00:00:04 | ETA: 00:00:03 | ETA: 00:00:03 | ETA: 00:00:03 | ETA: 00:00:03 | ETA: 00:00:03 | ETA: 00:00:03 | ETA: 00:00:02 | ETA: 00:00:02 | ETA: 00:00:02 | ETA: 00:00:02 | ETA: 00:00:02 | ETA: 00:00:02 | ETA: 00:00:01 | ETA: 00:00:01 | ETA: 00:00:01 | ETA: 00:00:01 | ETA: 00:00:01 | ETA: 00:00:01 | ETA: 00:00:00 | ETA: 00:00:00 | ETA: 00:00:00 | ETA: 00:00:00 | ETA: 00:00:00 | ETA: 00:00:00 | ETA: 00:00:00
Total time elapsed: 00:00:05

pyprind==2.9.9, jupyter==1.0.0, notebook==4.4.1

I'm not too familiar with the inner workings of this library, so hopefully you can let me know if this might be an issue with pyprind, or if I should open an issue in the jupyter notebook project.

Thanks in advance, Phil

anki-xyz commented 7 years ago

I have the same issue; however, my notebook version is 4.3.1.

rasbt commented 7 years ago

Thanks for the note! I haven't used it via Jupyter Notebooks for a while but it works fine in the terminal (bash shell). However, you are right, i am getting the same issue (repeated ETA). Not sure what's going on there ... I then installed an older version (pyprind 2.8) but I am getting the same issue. I suspect that there's sth that changed in Jupyter notebooks recently. I will try to look into that. If someone has an elegant fix at hand, pls let me know :)

pmorissette commented 7 years ago

Hey @rasbt,

Thanks for looking into this and please let me know if I should open an issue with Jupyter Notebook instead.

Cheers, Phil

rasbt commented 7 years ago

Alright, seems like it's fixed now :) (#38). Let me know if you encounter any issues with this!

pmorissette commented 7 years ago

Awesome @rasbt! Thanks for this.

Cheers, Phil