[Bug] Problem with tqdm
One of the most important packages for Jupyter does not work correctly in Helium. Each update of the progress bar is drawn on a new line. This is due to incorrect processing of the CR character.
If you give me a MWE (or not working in this case), I can look into it.
tqdm home: https://github.com/tqdm/tqdm MWE:
from tqdm import tqdm
for i in tqdm(range(1000000)): pass
This works correctly in any normal console. But with Helium we get:
(stderr):
<CR> 0%| | 0/1000000 [00:00<?, ?it/s]
(stderr):
<CR> 41%|████▏ | 412639/1000000 [00:00<00:00, 4126157.83it/s]
(stderr):
<CR> 92%|█████████▏| 916578/1000000 [00:00<00:00, 4663179.90it/s]
(stderr):
<CR>100%|██████████| 1000000/1000000 [00:00<00:00, 4629367.31it/s]
(stderr):
But you can consider a simpler example. This code:
print('1\r2')
should print 2 rather than 1<CR>2
Thanks. If you also send me your Helium config file, I can look into it.
There is nothing interesting there:
{
"complete": false,
"output_code": true,
"jupyter_path": "C:/SDK/Python/share/jupyter"
}
A similar bug is described in https://github.com/nteract/hydrogen/issues/466.
The main problem right now is that we don't handle text streams in a way that supports overwriting the previous line as is done by tqdm. While this is definitely a bug, right now I don't have the time to fix it, since this would most likely include a partial rewrite of the code displaying and printing outputs. Since something like this is planned anyways, this will not be fixed right now.
Sorry!