Skip to content

Conversation

lrq3000
Copy link
Member

@lrq3000 lrq3000 commented Sep 17, 2016

Implement #265 with 2 strategies: autodetection of stepsize if len(iterable) != total (total is explicitly specified) + autodetection in trange() of range() arguments to feed tqdm() (using a new function trange_preprocess() -- I wanted to turn trange() into a class but then the wrapper did not work anymore, it cannot just return a wrapped range under tqdm without wrapping in trange also).

TODO:

  • Call trange_preprocess() in all trange()-like of submodules.
  • Test impact on performance (examples/simple_tests.py) -> significative difference: 15% in manual mode and 5-10% in iterable mode. All because of tqdm.stepsize. If we remove tqdm.stepsize but keep trange_preprocess(), we would remove all performance impact, but iterable mode tqdm won't be able to account for range()'s stepsize (only initial and total, which is already good but not perfect). What should we do @casperdcl ?
  • Add unit test

@lrq3000 lrq3000 added p3-enhancement 🔥 Much new such feature need-feedback 📢 We need your response (question) labels Sep 17, 2016
Signed-off-by: Stephen L. <lrq3000@gmail.com>
@lrq3000 lrq3000 force-pushed the trange-autodetect-params branch from 2d8e028 to f9ca871 Compare September 18, 2016 10:08
@casperdcl casperdcl force-pushed the master branch 4 times, most recently from 8cade97 to a65e347 Compare October 31, 2016 02:34
@casperdcl
Copy link
Member

hmm, is this essentially a scale factor? eg instead of displaying 123/1000, show 234/2000?

@lrq3000
Copy link
Member Author

lrq3000 commented Nov 12, 2016

For stepsize yes, this is essentially a scale factor as far as i can see.
Le 12 Nov. 2016 17:29, "Casper da Costa-Luis" notifications@github.com a
écrit :

hmm, is this essentially a scale factor? eg instead of displaying
123/1000, show 234/2000?


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#273 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/ABES3pimNBrqpAYvPyZntnMnaaT9Amv0ks5q9emAgaJpZM4J_udf
.

@casperdcl
Copy link
Member

In that case I'd rather have this implemented as a unit_scale=x and passed directly to the formatter, where x=0|False|1|True are treated as before and other values multiply total and n.

@casperdcl casperdcl added this to the v5.0.0 milestone Nov 13, 2016
@lrq3000
Copy link
Member Author

lrq3000 commented Nov 13, 2016

Yes and they should multply at printing, like the other PR proposed. Indeed
this would probably reduce the overhead a lot, because I was not happy with
the way I implemented it, it was too costly. That's a good idea Casper :)

2016-11-13 11:56 GMT+01:00 Casper da Costa-Luis notifications@github.com:

In that case I'd rather have this implemented as a unit_scale=x and
passed directly to the formatter, where x=0|False|1|True are treated as
before and other values multiply total and n.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#273 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/ABES3up_ICdPaEoK9nk8OJ8SxKElgh8Yks5q9uzXgaJpZM4J_udf
.

casperdcl added a commit that referenced this pull request May 1, 2017
casperdcl added a commit that referenced this pull request May 29, 2017
@casperdcl
Copy link
Member

closing in favour of #378

@casperdcl casperdcl closed this Jul 22, 2017
casperdcl added a commit that referenced this pull request Jul 22, 2017
casperdcl added a commit that referenced this pull request Jul 22, 2017
@casperdcl casperdcl deleted the trange-autodetect-params branch May 3, 2021 00:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need-feedback 📢 We need your response (question) p3-enhancement 🔥 Much new such feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants