taps.executor.dask¶
DaskDistributedExecutor ¶
Bases: Executor
Dask task execution engine.
Parameters:
-
client(Client) –Dask distributed client.
Source code in taps/executor/dask.py
submit() ¶
Schedule the callable to be executed.
Parameters:
-
function(Callable[P, T]) –Callable to execute.
-
args(args, default:()) –Positional arguments.
-
kwargs(kwargs, default:{}) –Keyword arguments.
Returns:
Source code in taps/executor/dask.py
map() ¶
map(
function: Callable[P, T],
*iterables: Iterable[args],
timeout: float | None = None,
chunksize: int = 1
) -> Iterator[T]
Map a function onto iterables of arguments.
Parameters:
-
function(Callable[P, T]) –A callable that will take as many arguments as there are passed iterables.
-
iterables(Iterable[args], default:()) –Variable number of iterables.
-
timeout(float | None, default:None) –The maximum number of seconds to wait. If None, then there is no limit on the wait time.
-
chunksize(int, default:1) –Sets the Dask batch size.
Returns:
-
Iterator[T]–An iterator equivalent to:
map(func, *iterables)but the calls may be evaluated out-of-order.
Source code in taps/executor/dask.py
shutdown() ¶
Shutdown the client.
Source code in taps/executor/dask.py
DaskDistributedConfig ¶
Bases: ExecutorConfig
Dask Distributed configuration.
Attributes:
-
dask_scheduler_address(Optional[str]) –Dask scheduler address.
-
dask_use_threads(bool) –Use threads rather than processes for local clusters.
-
dask_workers(Optional[int]) –Number of Dask workers for local clusters.
add_argument_group()
classmethod
¶
add_argument_group(
parser: ArgumentParser,
*,
argv: Sequence[str] | None = None,
required: bool = True
) -> None
Add model fields as arguments of an argument group on the parser.
Parameters:
-
parser(ArgumentParser) –Parser to add a new argument group to.
-
argv(Sequence[str] | None, default:None) –Optional sequence of string arguments.
-
required(bool, default:True) –Mark arguments without defaults as required.
Source code in taps/config.py
get_executor() ¶
get_executor() -> DaskDistributedExecutor
Create an executor instance from the config.