Mercurial > repos > rliterman > csp2
annotate CSP2/CSP2_env/env-d9b9114564458d9d-741b3de822f2aaca6c6caa4325c4afce/lib/python3.8/site-packages/tqdm/auto.py @ 68:5028fdace37b
planemo upload commit 2e9511a184a1ca667c7be0c6321a36dc4e3d116d
author | jpayne |
---|---|
date | Tue, 18 Mar 2025 16:23:26 -0400 |
parents | |
children |
rev | line source |
---|---|
jpayne@68 | 1 """ |
jpayne@68 | 2 Enables multiple commonly used features. |
jpayne@68 | 3 |
jpayne@68 | 4 Method resolution order: |
jpayne@68 | 5 |
jpayne@68 | 6 - `tqdm.autonotebook` without import warnings |
jpayne@68 | 7 - `tqdm.asyncio` |
jpayne@68 | 8 - `tqdm.std` base class |
jpayne@68 | 9 |
jpayne@68 | 10 Usage: |
jpayne@68 | 11 >>> from tqdm.auto import trange, tqdm |
jpayne@68 | 12 >>> for i in trange(10): |
jpayne@68 | 13 ... ... |
jpayne@68 | 14 """ |
jpayne@68 | 15 import warnings |
jpayne@68 | 16 |
jpayne@68 | 17 from .std import TqdmExperimentalWarning |
jpayne@68 | 18 |
jpayne@68 | 19 with warnings.catch_warnings(): |
jpayne@68 | 20 warnings.simplefilter("ignore", category=TqdmExperimentalWarning) |
jpayne@68 | 21 from .autonotebook import tqdm as notebook_tqdm |
jpayne@68 | 22 |
jpayne@68 | 23 from .asyncio import tqdm as asyncio_tqdm |
jpayne@68 | 24 from .std import tqdm as std_tqdm |
jpayne@68 | 25 |
jpayne@68 | 26 if notebook_tqdm != std_tqdm: |
jpayne@68 | 27 class tqdm(notebook_tqdm, asyncio_tqdm): # pylint: disable=inconsistent-mro |
jpayne@68 | 28 pass |
jpayne@68 | 29 else: |
jpayne@68 | 30 tqdm = asyncio_tqdm |
jpayne@68 | 31 |
jpayne@68 | 32 |
jpayne@68 | 33 def trange(*args, **kwargs): |
jpayne@68 | 34 """ |
jpayne@68 | 35 A shortcut for `tqdm.auto.tqdm(range(*args), **kwargs)`. |
jpayne@68 | 36 """ |
jpayne@68 | 37 return tqdm(range(*args), **kwargs) |
jpayne@68 | 38 |
jpayne@68 | 39 |
jpayne@68 | 40 __all__ = ["tqdm", "trange"] |