satorbis_kit.dask_utils module

satorbis_kit.dask_utils.dask_client(scheduler_address: str | None = None, n_workers: int = 4, threads_per_worker: int = 1, processes: bool = True) Iterator[dask.distributed.Client][source]

Factory/context manager for a Dask Client.

  • If scheduler_address is provided, connects to that scheduler.

  • Otherwise, starts a local LocalCluster with the given worker config.

  • Set processes=False to run threads-only workers (useful on macOS to avoid spawn issues).

Yields an active Client and guarantees cleanup on exit.