-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Closed
Labels
duplicate 🗐Seen it beforeSeen it beforep4-enhancement-future 🧨On the back burnerOn the back burnerquestion/docs ‽Documentation clarification candidateDocumentation clarification candidatesubmodule ⊂Periphery/subclassesPeriphery/subclasses
Description
Hi! We use the tqdm in Catalyst a lot, thank you for this library.
My frequent case is to use tqdm
together with enumerate
. I keep forgetting in which order to pass what, according to this:
Wrapping enumerated iterables: use enumerate(tqdm(...)) instead of tqdm(enumerate(...)). The same applies to numpy.ndenumerate. This is because enumerate functions tend to hide the length of iterables. tqdm does not.
My suggestion is very simple, lets add an analog of trange
: tenumerate
to the standard functions. I can contribute this, the logic is very simple:
def tenumerate(iterable, **kwargs):
_enumerate = np.ndenumerate if isinstance(iterable, np.ndarray) else enumerate
return _enumerate(tqdm(iterable, **kwargs))
- I have marked all applicable categories:
- exception-raising bug
- visual output bug
- documentation request (i.e. "X is missing from the documentation." If instead I want to ask "how to use X?" I understand StackOverflow#tqdm is more appropriate)
- new feature request
- I have visited the source website, and in particular
read the known issues - I have searched through the issue tracker for duplicates
- I have mentioned version numbers, operating system and
environment, where applicable:import tqdm, sys print(tqdm.__version__, sys.version, sys.platform)
c-j-lh
Metadata
Metadata
Assignees
Labels
duplicate 🗐Seen it beforeSeen it beforep4-enhancement-future 🧨On the back burnerOn the back burnerquestion/docs ‽Documentation clarification candidateDocumentation clarification candidatesubmodule ⊂Periphery/subclassesPeriphery/subclasses