This works:
>>> def model(x):
... from mystic.models import griewangk
... return griewangk(x)
...
>>> from pathos.pools import ParallelPool
>>> p = ParallelPool()
>>> p.map(model, [[1,2,3],[4,5,6]])
[1.0170279701835734, 1.591708292293129]
>>>
However, without the encapsulated import, the map will hang (and require python to be manually killed). ppft provides the ability for the user to pass the appropriate required modules to the map, however a timeout could also be added for when the import is missing (or something else has gone awry that is causing the map to hang).
This works:
However, without the encapsulated
import, themapwill hang (and require python to be manually killed).ppftprovides the ability for the user to pass the appropriate required modules to themap, however a timeout could also be added for when theimportis missing (or something else has gone awry that is causing themapto hang).