bencher.job

Module Contents

Classes

Job

JobFuture

Executors

StrEnum is a Python enum.Enum that inherits from str. The default

FutureCache

The aim of this class is to provide a unified interface for running jobs. T

JobFunctionCache

The aim of this class is to provide a unified interface for running jobs. T

Functions

run_job(→ dict)

Attributes

scoop_future_executor

bencher.job.scoop_future_executor
class bencher.job.Job(job_id: str, function: Callable, job_args: dict, job_key=None, tag='')
class bencher.job.JobFuture(job: Job, res: dict = None, future: concurrent.futures.Future = None, cache=None)
result()
bencher.job.run_job(job: Job) dict
class bencher.job.Executors

Bases: strenum.StrEnum

StrEnum is a Python enum.Enum that inherits from str. The default auto() behavior uses the member name as its value.

Example usage:

class Example(StrEnum):
    UPPER_CASE = auto()
    lower_case = auto()
    MixedCase = auto()

assert Example.UPPER_CASE == "UPPER_CASE"
assert Example.lower_case == "lower_case"
assert Example.MixedCase == "MixedCase"
SERIAL
MULTIPROCESSING
SCOOP
static factory(provider: Executors)
class bencher.job.FutureCache(executor=Executors.SERIAL, overwrite: bool = True, cache_name: str = 'fcache', tag_index: bool = True, size_limit: int = int(20000000000.0), use_cache=True)

The aim of this class is to provide a unified interface for running jobs. T

submit(job: Job) JobFuture
overwrite_msg(job: Job, suffix: str) None
clear_call_counts() None

Clear the worker and cache call counts, to help debug and assert caching is happening properly

clear_cache() None
clear_tag(tag: str) None
close() None
stats() str
class bencher.job.JobFunctionCache(function: Callable, overwrite=False, executor: bool = False, cache_name: str = 'fcache', tag_index: bool = True, size_limit: int = int(10000000000.0))

Bases: FutureCache

The aim of this class is to provide a unified interface for running jobs. T

call(**kwargs) JobFuture