Skip to content

Commit

Permalink
Merge branch 'Zurga-master'
Browse files Browse the repository at this point in the history
  • Loading branch information
manu-mannattil committed Jun 17, 2018
2 parents 5f5a530 + 1596dc3 commit 9ea5aea
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions nolitsa/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,11 @@ def parallel_map(func, values, args=tuple(), kwargs=dict(),
results : array
Output after applying func on each element in values.
"""
# True single core processing, in order to allow the func to be executed in
# a Pool in a calling script.
if processes == 1:
return np.asarray([func(value, *args, **kwargs) for value in values])

from multiprocessing import Pool

pool = Pool(processes=processes)
Expand Down

0 comments on commit 9ea5aea

Please sign in to comment.