__init__.py 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. from .std import tqdm, trange
  2. from .gui import tqdm as tqdm_gui # TODO: remove in v5.0.0
  3. from .gui import trange as tgrange # TODO: remove in v5.0.0
  4. from ._tqdm_pandas import tqdm_pandas
  5. from .cli import main # TODO: remove in v5.0.0
  6. from ._monitor import TMonitor, TqdmSynchronisationWarning
  7. from ._version import __version__ # NOQA
  8. from .std import TqdmTypeError, TqdmKeyError, TqdmWarning, \
  9. TqdmDeprecationWarning, TqdmExperimentalWarning, \
  10. TqdmMonitorWarning
  11. __all__ = ['tqdm', 'tqdm_gui', 'trange', 'tgrange', 'tqdm_pandas',
  12. 'tqdm_notebook', 'tnrange', 'main', 'TMonitor',
  13. 'TqdmTypeError', 'TqdmKeyError',
  14. 'TqdmWarning', 'TqdmDeprecationWarning',
  15. 'TqdmExperimentalWarning',
  16. 'TqdmMonitorWarning', 'TqdmSynchronisationWarning',
  17. '__version__']
  18. def tqdm_notebook(*args, **kwargs): # pragma: no cover
  19. """See tqdm.notebook.tqdm for full documentation"""
  20. from .notebook import tqdm as _tqdm_notebook
  21. from warnings import warn
  22. warn("This function will be removed in tqdm==5.0.0\n"
  23. "Please use `tqdm.notebook.tqdm` instead of `tqdm.tqdm_notebook`",
  24. TqdmDeprecationWarning, stacklevel=2)
  25. return _tqdm_notebook(*args, **kwargs)
  26. def tnrange(*args, **kwargs): # pragma: no cover
  27. """
  28. A shortcut for `tqdm.notebook.tqdm(xrange(*args), **kwargs)`.
  29. On Python3+, `range` is used instead of `xrange`.
  30. """
  31. from .notebook import trange as _tnrange
  32. from warnings import warn
  33. warn("Please use `tqdm.notebook.trange` instead of `tqdm.tnrange`",
  34. TqdmDeprecationWarning, stacklevel=2)
  35. return _tnrange(*args, **kwargs)