Commit eab1b1b7 authored by Manuel Guenther's avatar Manuel Guenther
Browse files

Beuatified code

parent 7717742f
Pipeline #56726 passed with stage
in 10 minutes and 58 seconds
......@@ -67,11 +67,13 @@ def dask_get_partition_size(cluster, n_objects, lower_bound=200):
else n_objects
)
def get_local_parallel_client(parallel=None, processes=True):
"""Returns a local Dask client with the given parameters, see the dask documentation for details: https://docs.dask.org/en/latest/how-to/deploy-dask/single-distributed.html?highlight=localcluster#localcluster
Parameters
----------
parallel: int or None
The number of workers (processes or threads) to use; if `None`, take as many processors as we have on the system
......@@ -88,6 +90,6 @@ def get_local_parallel_client(parallel=None, processes=True):
cluster = LocalCluster(
processes=processes,
n_workers=parallel if processes else 1,
threads_per_worker= 1 if processes else parallel,
threads_per_worker=1 if processes else parallel,
)
return Client(cluster)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment