- bar for serial case

This commit is contained in:
Wim Pomp
2021-02-20 15:17:17 +01:00
parent 3d99250b98
commit 61f1429543
2 changed files with 2 additions and 2 deletions

View File

@@ -475,7 +475,7 @@ def pmap(fun, iterable=None, args=None, kwargs=None, length=None, desc=None, bar
except: except:
pass pass
if length and length<serial: #serial case if length and length<serial: #serial case
return [fun(c, *args, **kwargs) for c in iterable] return [fun(c, *args, **kwargs) for c in tqdm(iterable, total=length, desc=desc, disable=not bar)]
else: #parallel case else: #parallel case
with tqdmm(total=0, desc='Task buffer', disable=not qbar, leave=False) as qbar,\ with tqdmm(total=0, desc='Task buffer', disable=not qbar, leave=False) as qbar,\
tqdm(total=length, desc=desc, disable=not bar) as bar: tqdm(total=length, desc=desc, disable=not bar) as bar:

View File

@@ -5,7 +5,7 @@ with open("README.md", "r") as fh:
setuptools.setup( setuptools.setup(
name="parfor", name="parfor",
version="2021.1.5", version="2021.2.0",
author="Wim Pomp", author="Wim Pomp",
author_email="wimpomp@gmail.com", author_email="wimpomp@gmail.com",
description="A package to mimic the use of parfor as done in Matlab.", description="A package to mimic the use of parfor as done in Matlab.",