Skip to content
Snippets Groups Projects

Refactoring of arbiter to add flexibility and to allow reuse kernels

Merged Egor Sobolev requested to merge feat/multi-kernels-in-arbiter into master
1 unresolved thread
Files
14
@@ -3,9 +3,8 @@ import enum
class KernelWarning(enum.Enum):
INIT = "init"
MISSINGSOURCE = "missingsource"
MISSINGKEY = "missingkey"
PROCESSING = "processing"
PRESELECTION = "preselection"
class BaseArbiterKernel:
@@ -18,11 +17,6 @@ class BaseArbiterKernel:
def geometry(self):
return self._device._geometry
def warning_context(self, warn_type):
return self._device.warning_context(
f"frameSelection.selections.{self._name}.state", warn_type
)
@staticmethod
def extend_device_schema(schema, prefix):
"""Should add configurability to the arbiter (matcher) the kernel will be
@@ -36,10 +30,15 @@ class BaseArbiterKernel:
def extend_output_schema(schema, name):
pass
def consider(self, train_id, sources, num_frames, out_hash):
def consider(self, train_id, sources, num_frames, mask, out_hash):
"""Must return tuple of uint8 mask array of size equal to num_frames
and base output hash or None."""
return mask
raise NotImplementedError()
def reconfigure(self, config):
pass
class Assign(BaseArbiterKernel):
def consider(self, tid, src, nframes, mask, out):
return mask
Loading