Nested + desc = buggy PyCharm output
lrq3000 opened this issue · comments
Using the desc=
parameter with nested progress bars (the inner one) corrupts the output and gets you multiple progress bars like this:
Only two nested progress bars were used in this example.
Removing desc
makes it go back to normal.
Reported by @CrazyPython in #87.
@lrq3000 This is not limited to PyCharm. This happens everywhere. Occurs in:
- Raw terminal
- PyCharm embedded terminal
- PyCharm Run/Debug window
Also, if you don't have a desc=
parameter, it occurs in the PyCharm Run/Debug window but not any terminal.
It's more important than you think.
@CrazyPython Can you tell me what platform and what version of Python you are using please?
As a guess it may be related to not being able to detect the terminal width correctly due to your environment; and the fallback width only works without a "desc". Or... when I try 2 bars with a large window size and then resize to a small window while they're running (or vice versa) the first bar doesn't resize.
@CrazyPython Could you please try @casperdcl hypothesis please by setting ncols=10
for each tqdm bar in your loop, and see if it fixes some issues? (because I guess there are several ones in this case).
@lrq3000 @casperdcl CrazyPython CI has finally finished. Here are the results:
Environment | Result | Old Result |
---|---|---|
Terminal | ✓* | ✘ |
PyCharm | ✘ | ✘ |
And PyCharm embedded terminal is a simple wrapper over the normal terminal so no point in testing that.
* CrazyPython CI has detected an 1 anomaly:
After program exits on terminal, the prompt is left with the junk
$ 9.85it/s]
presumably same if you set dynamic_ncols=True
?
This is because PYCHARM does not support the "up" control character, so you
cannod get a nice output with multiple progress bars. You either have do
limit yourself to 1 bar or use the os console to run your python script if
you need multiple bars.
Le 25 Oct. 2016 10:56, "Noé Casas" notifications@github.com a écrit :
This happens to me in the Pycharm Python Console without nested bars, just
a normal progress bar. Neither ncols=10 nor dynamic_cols=True have effect.My environment is Ubuntu 16.04, Python 2.7.11 and Pycharm Community
2016.2.3.—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#203 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/ABES3vm7loXkdGPPvYGR7OwF8-gDNKDuks5q3cQugaJpZM4JROq9
.
can't do anything about pycharm here... if someone want to create a PR which prints a warning for pycharm environments go ahead.
pycharm support tracked here: https://youtrack.jetbrains.com/issue/PY-6646
Tracked here now: https://youtrack.jetbrains.com/issue/PY-33061
Expected in 2019.1
@jimanvlad Are nested progressbars supposed to work in 2019.3?
You can use "Emulate terminal in output console" under the Execution/Run&Debug window and set leave=False
in the nested bar params