Skip to content

Commit

Permalink
bump version, merge branch 'devel'
Browse files Browse the repository at this point in the history
- fix missing `sys.setcheckinterval` in py3.9 (#978)
- fix `keras.TqdmCallback` compatibility with `tensorflow==2.2.0` (#979)
- update documentation
  + correct `contrib.concurrent` correct `max_workers` (#977)
  + drop prominent mention of `xrange` (#965)
  • Loading branch information
casperdcl committed Jun 3, 2020
2 parents 571f0ed + 133b218 commit 1e0bb74
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .meta/.readme.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ iterable with ``tqdm(iterable)``, and you're done!
``76%|████████████████████████        | 7568/10000 [00:33<00:10, 229.00it/s]``

``trange(N)`` can be also used as a convenient shortcut for
``tqdm(xrange(N))``.
``tqdm(range(N))``.

|Screenshot|
|Video| |Slides|
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ iterable with ``tqdm(iterable)``, and you're done!
``76%|████████████████████████        | 7568/10000 [00:33<00:10, 229.00it/s]``

``trange(N)`` can be also used as a convenient shortcut for
``tqdm(xrange(N))``.
``tqdm(range(N))``.

|Screenshot|
|Video| |Slides|
Expand Down
2 changes: 1 addition & 1 deletion tqdm/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
__all__ = ["__version__"]

# major, minor, patch, -extra
version_info = 4, 46, 0
version_info = 4, 46, 1

# Nice string for the version
__version__ = '.'.join(map(str, version_info))
Expand Down
4 changes: 2 additions & 2 deletions tqdm/contrib/concurrent.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def _executor_map(PoolExecutor, fn, *iterables, **tqdm_kwargs):
Parameters
----------
tqdm_class : [default: tqdm.auto.tqdm].
max_workers : [default: max(32, cpu_count() + 4)].
max_workers : [default: min(32, cpu_count() + 4)].
chunksize : [default: 1].
"""
kwargs = deepcopy(tqdm_kwargs)
Expand Down Expand Up @@ -87,7 +87,7 @@ def process_map(fn, *iterables, **tqdm_kwargs):
max_workers : int, optional
Maximum number of workers to spawn; passed to
`concurrent.futures.ProcessPoolExecutor.__init__`.
[default: max(32, cpu_count() + 4)].
[default: min(32, cpu_count() + 4)].
chunksize : int, optional
Size of chunks sent to worker processes; passed to
`concurrent.futures.ProcessPoolExecutor.map`. [default: 1].
Expand Down
9 changes: 9 additions & 0 deletions tqdm/keras.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,3 +91,12 @@ def on_train_end(self, *_, **__):
if self.verbose:
self.batch_bar.close()
self.epoch_bar.close()

def _implements_train_batch_hooks(self):
return True

def _implements_test_batch_hooks(self):
return True

def _implements_predict_batch_hooks(self):
return True
5 changes: 4 additions & 1 deletion tqdm/tests/tests_tqdm.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,10 @@ def cpu_timify(t, timer=None):

def pretest():
# setcheckinterval is deprecated
getattr(sys, 'setswitchinterval', getattr(sys, 'setcheckinterval'))(100)
try:
sys.setswitchinterval(1)
except AttributeError:
sys.setcheckinterval(100)

if getattr(tqdm, "_instances", False):
n = len(tqdm._instances)
Expand Down

0 comments on commit 1e0bb74

Please sign in to comment.