rascheduler module

exception ConfigError[source]

Bases: Exception

exception ExecutorError[source]

Bases: RuntimeError

exception ProcessError[source]

Bases: TypeError

class RAExec(taggers_in_order: Iterable[ReadAwareProcessProtocol[RunParams, FixedParams | None, None]], flaggers_in_order: Iterable[ReadAwareProcessProtocol[RunParams, FixedParams | None, FlagResult]], mandate_excludes: bool)[source]

Bases: object

property mandate_excludes
property taggers
property flaggers
static check_namespacing_clashfree(processes: Iterable[ReadAwareProcessProtocol[Any, Any, Any]])[source]
static validate_exec(processes: Iterable[ReadAwareProcessProtocol[Any, Any, Any]], mandate_excludes: bool, raise_on_fail: bool) tuple[bool, tuple[tuple[ReadAwareProcessProtocol[Any, Any, None], ...], tuple[ReadAwareProcessProtocol[Any, Any, FlagResult], ...]]][source]
static validate_tagger_order(processes: Iterable[ReadAwareProcessProtocol[RunParams, FixedParams | None, None]], mandate_excludes: bool, raise_on_fail: bool = False) tuple[bool, set[str]][source]

Validate that the order of tagger processes as provided in the processes iterable can be run without error. In practice this means checking that at a minimum, all marks/tags listed in a given process as required (i.e. in require_marks) have been checked and applied by processes occurring prior in the run order.

Parameters:
  • processes (Iterable) – Iterable of processes, the order of which defines the run order

  • mandate_excludes (bool) – if true, then for each process, all marks listed as exclude_marks must have been applied by tagger processes coming prior in the run order, in addition to require_marks

  • raise_on_fail (bool) – whether to throw an error on receiving an illegal order, or just return a bool

static validate_flagger_exec(processes: Iterable[ReadAwareProcessProtocol[RunParams, FixedParams | None, FlagResult]], tags_set: set[str], mandate_excludes: bool, raise_on_fail: bool = False)[source]
classmethod from_config(configd: dict[str, Any], proc_pool: Iterable[type[ReadAwareProcessProtocol[RunParams, FixedParams | None, FlagResult | None]]]) Self[source]

Initialise read-aware executor from config dict.

Parameters:
  • configd (dict[str, Any]) – Dictionary describing how processes should execute.

  • proc_pool (Iterable[type[ReadAwareProcess]]) – Iterable of process definitions which may be instatiated for a given run.

run(run_data: RunParams) tuple[FlagResult, ...][source]