more meaningful message
if add_xxx (Results) does not find matching datasets, inform the user about this fact instead of saying TypeError: object of type 'IMapUnorderedIterator' has no len()
This commit is contained in:
parent
b9f1421c6b
commit
c5761831e2
|
@ -1065,6 +1065,10 @@ class Result:
|
||||||
lock = mp.Manager().Lock()
|
lock = mp.Manager().Lock()
|
||||||
|
|
||||||
groups = self.groups_with_datasets(datasets.values())
|
groups = self.groups_with_datasets(datasets.values())
|
||||||
|
if len(groups) == 0:
|
||||||
|
print('No matching dataset found, no data was added.')
|
||||||
|
return
|
||||||
|
|
||||||
default_arg = partial(self._job,func=func,datasets=datasets,args=args,lock=lock)
|
default_arg = partial(self._job,func=func,datasets=datasets,args=args,lock=lock)
|
||||||
|
|
||||||
for result in util.show_progress(pool.imap_unordered(default_arg,groups),len(groups)):
|
for result in util.show_progress(pool.imap_unordered(default_arg,groups),len(groups)):
|
||||||
|
|
Loading…
Reference in New Issue