Skip to content

Commit

Permalink
bump version, merge pull request tqdm#1311 from tqdm/devel
Browse files Browse the repository at this point in the history
  • Loading branch information
casperdcl authored Apr 3, 2022
2 parents 165a23a + 9f0ffe6 commit 87d253f
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .meta/.readme.rst
Original file line number Diff line number Diff line change
Expand Up @@ -757,7 +757,7 @@ custom callback take advantage of this, simply use the return value of
class TqdmExt(std_tqdm):
def update(self, n=1):
displayed = super(TqdmExt, self).update(n):
displayed = super(TqdmExt, self).update(n)
if displayed:
external_callback(**self.format_dict)
return displayed
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -976,7 +976,7 @@ custom callback take advantage of this, simply use the return value of
class TqdmExt(std_tqdm):
def update(self, n=1):
displayed = super(TqdmExt, self).update(n):
displayed = super(TqdmExt, self).update(n)
if displayed:
external_callback(**self.format_dict)
return displayed
Expand Down
4 changes: 2 additions & 2 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ dependencies:
- wheel # `setup.py bdist_wheel`
# `cd docs && pymake`
- mkdocs-material
- pydoc-markdown >=3.3.0
- pydoc-markdown >=4.6.0
- pygments
- pymdown-extensions
- pip:
- py-make >=0.1.0 # `setup.py make/pymake`
- mkdocs-minify-plugin # `cd docs && pymake`
- git+git://github.com/tqdm/jsmin@python3-only#egg=jsmin # `cd docs && pymake`
- git+https://github.com/tqdm/jsmin@python3-only#egg=jsmin # `cd docs && pymake`
3 changes: 0 additions & 3 deletions tqdm/autonotebook.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,13 @@
>>> for i in trange(10):
... ...
"""
import os
import sys
from warnings import warn

try:
get_ipython = sys.modules['IPython'].get_ipython
if 'IPKernelApp' not in get_ipython().config: # pragma: no cover
raise ImportError("console")
if 'VSCODE_PID' in os.environ: # pragma: no cover
raise ImportError("vscode")
from .notebook import WARN_NOIPYW, IProgress
if IProgress is None:
from .std import TqdmWarning
Expand Down
6 changes: 5 additions & 1 deletion tqdm/rich.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,15 @@ def __init__(self, *args, **kwargs):
----------
progress : tuple, optional
arguments for `rich.progress.Progress()`.
options : dict, optional
keyword arguments for `rich.progress.Progress()`.
"""
kwargs = kwargs.copy()
kwargs['gui'] = True
# convert disable = None to False
kwargs['disable'] = bool(kwargs.get('disable', False))
progress = kwargs.pop('progress', None)
options = kwargs.pop('options', {}).copy()
super(tqdm_rich, self).__init__(*args, **kwargs)

if self.disable:
Expand All @@ -108,7 +111,8 @@ def __init__(self, *args, **kwargs):
",", RateColumn(unit=d['unit'], unit_scale=d['unit_scale'],
unit_divisor=d['unit_divisor']), "]"
)
self._prog = Progress(*progress, transient=not self.leave)
options.setdefault('transient', not self.leave)
self._prog = Progress(*progress, **options)
self._prog.__enter__()
self._task_id = self._prog.add_task(self.desc or "", **d)

Expand Down
2 changes: 1 addition & 1 deletion tqdm/std.py
Original file line number Diff line number Diff line change
Expand Up @@ -672,7 +672,7 @@ def pandas(cls, **tqdm_kwargs):
| groupby.(generic.)SeriesGroupBy
).progress_apply
A new instance will be create every time `progress_apply` is called,
A new instance will be created every time `progress_apply` is called,
and each instance will automatically `close()` upon completion.
Parameters
Expand Down

0 comments on commit 87d253f

Please sign in to comment.