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
Sub stats showed as an unique progress bar #77
Comments
I believe this is solved if you set the |
Also |
Let me know if you prefer and have (attempted to) implement a subclass, I'll reopen the issue and we can add it here. |
Subclassing would be an ideal solution if module functions like "format_meter()" or "StatusPrinter()" would be methods of class tqdm. Then I could replace them easily in a subclass. For compatibility reasons maybe would be easier to add them as constructor parameters (with default values = current functions). Without this help, I must rewrite most logic in my subclass. |
I could make both |
Agree, this would make subclassing way easier and more powerful. However, I hope this won't hit performance too much, we'll test that out (as |
No idea about performance but yes, this would help a lot. |
Great. Any date for a PYPI release? |
er... yeah. when I get around to feeling OK with #87 ... Spent ages trying to optimise it ;) |
Crossing fingers and biting my nails... |
Great work Casper! 2016-01-13 0:33 GMT+01:00 Casper da Costa-Luis notifications@github.com:
|
I still changed the version and upload to pypi so we just need to fix the 2016-01-13 11:48 GMT+01:00 Stephen LARROQUE lrq3000@gmail.com:
|
I'm updating the setup.py classifier troves, so I'm going to update to version 3.7.1 by the way. |
oops my bad. Forgot to double check _version.py |
nvm it happens :) But do you have a way to update _version.py directly on master branch without using a PR? For instance, I saw you can change the version during a merge, but I didn't see the version changes in the branches. Can you do that during the merge or in fact you push to the branch before merging to master? |
Please, write a changelog too, inlined or linked in PYPI. I hate to "diff" between releases to know what is new :). Something to add to the "RELEASE" file :-). |
@jcea I write changelogs on github (https://github.com/tqdm/tqdm/releases). If you want to look through those and add them to the RELEASE file in a PR, I'll be happy to merge it in. |
@lrq3000 I can update |
@casperdcl Yes the 3.7.1 was just an excuse to fix the versioning by fixing the setup.py file by the way ;) 3.7.0 on Github should not be used since its version is not correct, but the one on PyPi is OK. |
@jcea I'm not really a huge fan of putting all changes in a CHANGELOG, because it pollutes the commits (we already have the git commit + GitHub releases descriptions to detail and summary the changes). Sure, I've done it a lot in the past for other projects, but it was just because I didn't have another place to put the changes (ie, I was not using git nor github releases). But well, if you really think that's a necessary addition, then why not... |
@casperdcl, I was trying to say that the project should include a "changelog" file in the package, and it should be pasted or linked in PYPI. My opinion, of course :). In this particular case, a link in PYPI (named "changelog") pointing to https://github.com/tqdm/tqdm/releases would be enough for me. |
@lrq3000, think about people unfamiliar with the project. The changelog is for those people, not for you :-). I have been using this project for a month and even providing some ideas and PR, and I was lost when 3.7.1 was released. I just read the code to review the changes myself. "Changelog" is standard practice for a reason :). |
I'm not saying we don't need a changelog, but rather that we already have a 2016-01-14 3:16 GMT+01:00 jcea notifications@github.com:
|
Another possibility instead of manually maintaining a CHANGELOG: we can 2016-01-14 8:52 GMT+01:00 Stephen LARROQUE lrq3000@gmail.com:
|
The most simple approach for you is just to add a link in PYPI to the github changelog page. |
Going back to the original aim of this issue :-), I have coded my idea using TQDM 3.7.1 ability to subclass tqdm class easily. Here is the result:
I hope this is useful to anybody. Remember that I usually have like 2-3 updates per second, so performance is a non issue. Also, the code is running in Python 3.5, I don't care about 2.x anymore. Finally, this code solves my use case, it is not ready-to-use generic code. It is an example. Feel free to add it to the examples collection. Thanks for your work in tqdm. It is highly appreciated. |
Ok, thanks. Could you provide a minimal example use case for this code? |
Sure. This is a fragment of my production code:
I create a "metaprogres" bar with the details: name, total, initial. Then I create threading workers passing to them a new instance each of a "virtual" progress bar with "metaprogress.new_subprogress()". Each worker call its private "subprogress" object. They keep stats private and call the "metaprogress" parent to totalize and actually display the actual progress bar. Since this could be called by several threads at the same time, I use a lock to protect the totalization & display. If contention is low, the lock is not a performance problem (it will be almost always unlocked), and if the contention is high, you better have a lock protecting you :-) I hope I have explained it easy enough. Let me know if not. |
Thank you @jcea, we'll see if we can turn that into a tqdm subclass. |
I have thinking about this for a couple of days.
Lets say I have two threads working in parallel in a single problem. The counter update would be something similar to this: long pause, an update (thread 1), short pause, another update (thread 2), long pause... Those two close updates break the speed and ETA estimation.
Thinking of more sophisticated algorithms, I realized that the problem is actually pretty simple if we keep average speed for both threads separated and just accumulate it when printed.
I realize that this code is a bit specialized but I think it would be a nice feature. If you are not interested or you are worried about this change impacting performance, would be nice to provide some hooks to specialize via the constructor of thru subclassing.
What do you think?
Thanks.
The text was updated successfully, but these errors were encountered: