pydra icon indicating copy to clipboard operation
pydra copied to clipboard

Remove the ability to pass worker kwargs to Submitter/Task.__call__()

Open tclose opened this issue 9 months ago • 4 comments

This is a question I have been playing with in my head and think probably warrants discussion before we lock in the syntax. It is super convenient to be able to pass worker kwargs when executing tasks, e.g.

outputs = my_task(worker="cf", n_procs=2)

However, there is a risk of the worker kwargs (especially if they are in a plugin) clashing with the names of future kwargs we may want to add to the Submitter.__init__/Task.__call__ methods. Therefore, it would be cleaner/safer to just pass the worker object as

from pydra.workers.cf import ConcurrentFutures

outputs = my_task(worker=ConcurrentFutures(n_procs=2))

although more verbose and painful.

Thoughts?

tclose avatar Apr 08 '25 03:04 tclose