lenskit.parallel.invoker#

lenskit.parallel.invoker(model, func, n_jobs=None, *, worker_parallel=None)#

Get an appropriate invoker for performing operations on model.

Parameters:
  • model (M) – The model object on which to perform operations.

  • func (Callable[[M, A], R]) – The function to call. The function must be pickleable.

  • n_jobs (int | None) – The number of processes to use for parallel operations. If None, will call proc_count() with a maximum default process count of 4.

  • worker_parallel (ParallelConfig | None) – A parallel configuration for subprocess workers.

Returns:

An invoker to perform operations on the model.

Return type:

ModelOpInvoker