Skip to content

Commit

Permalink
Further fix
Browse files Browse the repository at this point in the history
  • Loading branch information
williamjameshandley committed Aug 5, 2018
1 parent 6559a38 commit c6d109e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions fgivenx/parallel.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,6 @@ def parallel_apply(f, array, **kwargs):
if not parallel:
return [f(*(precurry + (x,) + postcurry)) for x in
progress(array, **tqdm_kwargs)]
elif parallel and not PARALLEL:
warnings.warn("You need to install the package joblib if you want to use parallelisation")
elif parallel is True:
parallel = cpu_count()
elif isinstance(parallel, int):
Expand All @@ -90,5 +88,8 @@ def parallel_apply(f, array, **kwargs):
else:
raise ValueError("parallel keyword must be an integer or bool")

if parallel and not PARALLEL:
warnings.warn("You need to install the package joblib if you want to use parallelisation")

return Parallel(n_jobs=parallel)(delayed(f)(*(precurry + (x,) + postcurry))
for x in progress(array, **tqdm_kwargs))

0 comments on commit c6d109e

Please sign in to comment.