From e03c14fa4f230e92ebc6c139b1e5046efd1fff86 Mon Sep 17 00:00:00 2001 From: John Truckenbrodt Date: Tue, 9 Apr 2024 10:46:02 +0200 Subject: [PATCH] [ancillary.multicore] improved error message --- spatialist/ancillary.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spatialist/ancillary.py b/spatialist/ancillary.py index 8aa39a4..5f5336c 100644 --- a/spatialist/ancillary.py +++ b/spatialist/ancillary.py @@ -323,6 +323,8 @@ def multicore(function, cores, multiargs, pbar=False, **singleargs): arglengths = list(set([len(multiargs[x]) for x in multiargs])) if len(arglengths) > 1: raise AttributeError('multi argument lists of different length') + if arglengths[0] == 0: + raise RuntimeError('did not get any multiargs') # prevent starting more threads than necessary cores = cores if arglengths[0] >= cores else arglengths[0]