From 9caeb06c2ba2e9ec3a35c846718b06dc3c74ed3e Mon Sep 17 00:00:00 2001 From: Wim Pomp Date: Tue, 25 May 2021 10:51:14 +0200 Subject: [PATCH] - Bugfix --- parfor/__init__.py | 4 +++- setup.py | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/parfor/__init__.py b/parfor/__init__.py index 3047259..0e90c97 100644 --- a/parfor/__init__.py +++ b/parfor/__init__.py @@ -127,12 +127,14 @@ class chunks(): """ def __init__(self, *args, **kwargs): - N = min(*[len(a) for a in args]) if len(args) > 1 else len(args[0]) if 's' in kwargs and 'n' in kwargs: + N = min(*[len(a) for a in args]) if len(args) > 1 else len(args[0]) n = kwargs['n'] if N < kwargs['s'] * kwargs['n'] else round(N / kwargs['s']) elif 's' in kwargs: # size of chunks + N = min(*[len(a) for a in args]) if len(args) > 1 else len(args[0]) n = round(N / kwargs['s']) elif 'n' in kwargs: # number of chunks + N = min(*[len(a) for a in args]) if len(args) > 1 else len(args[0]) n = kwargs['n'] else: # size of chunks in 1st argument s, *args = args diff --git a/setup.py b/setup.py index 7faa8cf..fbefeaf 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ with open("README.md", "r") as fh: setuptools.setup( name="parfor", - version="2021.5.1", + version="2021.5.2", author="Wim Pomp", author_email="wimpomp@gmail.com", description="A package to mimic the use of parfor as done in Matlab.",