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
Tqdm tk #1006
Tqdm tk #1006
Conversation
Codecov Report
@@ Coverage Diff @@
## devel #1006 +/- ##
==========================================
+ Coverage 85.37% 86.89% +1.51%
==========================================
Files 22 22
Lines 1279 1335 +56
Branches 218 225 +7
==========================================
+ Hits 1092 1160 +68
+ Misses 166 151 -15
- Partials 21 24 +3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looking good, @richardsheridan - let me know when you think it's ready. Does look like a good idea to recommend it over the mpl implementation.
Thanks @casperdcl! I am happy with it right now, so please review the new commits. also, if you have any ideas/suggestions on aesthetic improvements, I'm willing to try to accommodate. |
improvements will probably best be done iteratively; I'm sure planet Earth will chime in. Can't guarantee when I'll have time to review (I'm not funded for |
195bd78
to
a87a08e
Compare
8ef07be
to
041e5a7
Compare
Codecov Report
@@ Coverage Diff @@
## devel #1006 +/- ##
==========================================
- Coverage 86.46% 86.39% -0.08%
==========================================
Files 22 22
Lines 1456 1463 +7
Branches 247 247
==========================================
+ Hits 1259 1264 +5
- Misses 165 168 +3
+ Partials 32 31 -1 |
5c62464
to
40781d5
Compare
dfbef39
to
b763adf
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot @richardsheridan 🎊 - I've finally reviewed this and also rebased onto the current release.
- split back into original
tqdm.gui
and newtqdm.tk
- added you as main author
- fixed conflicts, updated inheritance-related things & style fixes
- left 3
# WIP
comments (see https://github.com/tqdm/tqdm/pull/1006/files)
Regarding the WIP comments, I think the right way to do those color changes is with I subclassed refresh to make sure we never interact with the lock without changing the interface, as it is unnecessary for the display. I'm happy to drop it if you think that that is better! |
yes, that would be great.
Probably better to not bother overriding. If the |
Changing the progress bar color requires using a non-default theme that may make the bar look less native on some platforms. Also, did you want the text to change color too? |
ideally only the bar colour, not text (as with Could expose |
Using the non-default theme has the knock-on effect of changing the style of an entire tk app if the progress bar is embedded in a larger program. It would be the equivalent of setting an entire jupyter notebook to dark mode just to change the colorbar color, so I think skipping the color customization makes sense. A very interested user can manipulate the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great!
This PR adds a Tkinter based GUI for tqdm. It does not attempt to provide the graphs of the current
tqdm_gui
, but it is more performant, and suitable for use on the command line, within fully-fledged Tkinter apps, or even crazier cases, like the trio guest mode async await tkinter app that I originally built it for. One outstanding bug is that Tkinter does not play well with theTmonitor
functionality, so I disabled it by default for now by setting the class attributemonitor_interval=0
.This PR does not touch the broader, non-experimental functionality of tqdm.
I would boldly suggest making this class the default
tqdm.gui.tqdm
, as it is lighter-weight and has fewer dependencies compared to thematplotlib.pyplot
-based implementation. That could be renamed totqdm_mpl
or something like that, depending on how committed to backwards compatibility you are for these experimental bits.