foxes.utils.runners.DaskRunner

class foxes.utils.runners.DaskRunner[source]

Bases: Runner

Class for function execution via dask

Parameters:
  • scheduler (str, optional) – The dask scheduler choice

  • n_workers (int, optional) – The number of workers for parallel run

  • threads_per_worker (int, optional) – The number of threads per worker for parallel run

  • progress_bar (bool) – Flag for showing progress bar

  • cluster_args (dict, optional) – Explicit arguments for the cluster setup

  • client_args (dict, optional) – Explicit arguments for the client setup

  • verbosity (int) – The verbosity level, 0 = silent

scheduler

The dask scheduler choice

Type:

str, optional

progress_bar

Flag for showing progress bar

Type:

bool

cluster_args

Explicit arguments for the cluster setup

Type:

dict, optional

client_args

Explicit arguments for the client setup

Type:

dict, optional

verbosity

The verbosity level, 0 = silent

Type:

int

__init__(scheduler=None, n_workers=None, threads_per_worker=None, processes=True, cluster_args=None, client_args={}, progress_bar=True, verbosity=1)[source]

Methods

__init__([scheduler, n_workers, ...])

finalize()

Finallize the runner

initialize()

Initialize the runner

is_distributed()

print(*args, **kwargs)

Prints if verbosity is not zero

run(func[, args, kwargs])

Runs the given function.

Attributes

initialized

Initialization flag

__init__(scheduler=None, n_workers=None, threads_per_worker=None, processes=True, cluster_args=None, client_args={}, progress_bar=True, verbosity=1)[source]
finalize()[source]

Finallize the runner

initialize()[source]

Initialize the runner

property initialized

Initialization flag

Returns:

Initialization flag

Return type:

bool

print(*args, **kwargs)[source]

Prints if verbosity is not zero

run(func, args=(), kwargs={})[source]

Runs the given function.

Parameters:
  • func (Function) – The function to be run

  • args (tuple) – The function arguments

  • kwargs (dict) – The function keyword arguments

Returns:

results – The functions return value

Return type:

Any