Skip to content

map should have timeout to mitigate hang on missing import #7

@mmckerns

Description

@mmckerns

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).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions