profit.run.worker

proFit worker class & components

Module Contents

Classes

Worker

Helper class that provides a standard way to create an ABC using

Functions

main()

entry point to run a worker

class profit.run.worker.Worker(run_id: int, *, interface: profit.run.interface.WorkerInterface = 'memmap', debug=False, log_path='log', logger=None)[source]

Bases: profit.util.component.Component

Helper class that provides a standard way to create an ABC using inheritance.

abstract work()[source]
clean()[source]
classmethod from_config(config, interface, run_id)[source]
classmethod from_env(env=None)[source]
classmethod wrap(label, outputs=None, inputs=None)[source]

``` @Worker.wrap(‘label’, [‘f’, ‘g’], [‘x’, ‘y’]) def func(x, y):

@Worker.wrap(‘label’, [‘f’, ‘g’]) def func(x, y):

@Worker.wrap(‘label’) def func(x, y) -> [‘f’, ‘g’]:

@Worker.wrap(‘name’, ‘f’, ‘x’) def func(x):

@Worker.wrap(‘name’) def func(x) -> ‘f’:

@Worker.wrap(‘name’) def f(x):

```

profit.run.worker.main()[source]

entry point to run a worker

the run id and the path to the proFit configuration is provided via environment variables