straindesign.pool ================= .. py:module:: straindesign.pool .. autoapi-nested-parse:: Provide a process pool with enhanced performance on Windows, copied and slightly adapted from cobra. Module Contents --------------- .. py:class:: SDPool(processes: Optional[int] = None, initializer: Optional[Callable] = None, initargs: Tuple = (), maxtasksperchild: Optional[int] = None, context=None) Bases: :py:obj:`multiprocessing.pool.Pool` Multiprocessing process pool with enhanced Windows compatibility Initialize a process pool. Add a thin layer on top of the `multiprocessing.Pool` that, on Windows, passes initialization code to workers via a pickle file rather than directly. This is done to avoid a performance issue that exists on Windows. Please, also see the discussion [1_]. .. rubric:: References .. [1] https://github.com/opencobra/cobrapy/issues/997 .. py:method:: __exit__(*args, **kwargs) Clean up resources when leaving a context .. py:method:: close() Call cleanup function and close