From 396a1a791d4b79b12a91433be114ab46625d9d86 Mon Sep 17 00:00:00 2001 From: Wim Pomp Date: Mon, 21 Oct 2024 10:25:17 +0200 Subject: [PATCH] - gmap bugfix --- parfor/__init__.py | 6 ++++-- pyproject.toml | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/parfor/__init__.py b/parfor/__init__.py index e8bde20..01d6ee3 100644 --- a/parfor/__init__.py +++ b/parfor/__init__.py @@ -208,8 +208,10 @@ def gmap(fun: Callable[[Iteration, Any, ...], Result], iterable: Iterable[Iterat def chunk_fun(iterable: Iterable, *args: Any, **kwargs: Any) -> list[Result]: # noqa return [fun(iteration, *args, **kwargs) for iteration in iterable] - args = args or () - kwargs = kwargs or {} + if args is None: + args = () + if kwargs is None: + kwargs = {} if 'total' not in bar_kwargs: bar_kwargs['total'] = sum(iterable.lengths) diff --git a/pyproject.toml b/pyproject.toml index 6c1ed24..c54910c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "parfor" -version = "2024.10.1" +version = "2024.10.2" description = "A package to mimic the use of parfor as done in Matlab." authors = ["Wim Pomp "] license = "GPLv3"