Core
KoshOperator
Bases: KoshExecutionGraph
Source code in kosh/operators/core.py
__init__(*args, **kargs)
init function output signature is generated from the input args (w/o the cache_dir)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cache_dir
|
str
|
directory to save cached files must be passed as key/value |
required |
cache
|
int
|
do we use cache? 0: no, 1:yes, 2:yes but clobber if exists must be passed as key/value |
required |
verbose
|
bool
|
Turn on verbosity, by default this will turn on printing a message
when results are loaded from cache. Message is sent as lone argument
to |
required |
Source code in kosh/operators/core.py
operate(*inputs, **kargs)
abstractmethod
The operating function on the inputs
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
inputs
|
tuple of features/execution graphs
|
result returned by loader or previous transformer |
()
|
Source code in kosh/operators/core.py
operate_(*inputs, **kargs)
Given input(s) from previous loader, transformer or operators and desired format
computes the unique signature and tries to extract from cache, calls operator's
operate function if no cache available.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
*inputs
|
object
|
set of input passed from loader or previous transformer |
()
|
format
|
str
|
desired output format, must be passed as keyword will be attached to object for retrieval in the function |
required |
Returns:
| Type | Description |
|---|---|
object
|
The result from operate function on inputs |