schrodinger.tasks.v2.base module

Runner pipeline: preprocessing, launching, watching, loading, and orchestration.

class schrodinger.tasks.v2.base.BasePreprocessHandler

Bases: _FailureCaptureMixin

__init__()
hasRun() bool

Return whether preprocess has been called.

preprocess(task: Task) bool

Return whether all preprocessors passed.

Exceptions raised by individual preprocessor methods are captured as FailureInfo rather than propagated.

handleWarning(result: ProcessingResult) bool
handleError(result: ProcessingResult) None
class schrodinger.tasks.v2.base.BaseLauncher(runner_id: str, task: Task)

Bases: _FailureCaptureMixin

Creates an input context from the task, packs it using the packer, and sends the resulting packet to the execution environment.

Packer = NotImplemented
__init__(runner_id: str, task: Task)
launch(watcher: BaseWatcher) None

Build the input packet and launch. Failures are captured.

class schrodinger.tasks.v2.base.BaseWatcher

Bases: object

Monitors a running task and invokes callbacks on completion and progress changes.

__init__()
getFailureInfo() FailureInfo | None

Return failure information, or None if no failure occurred.

isDone() bool
getProgress() int
wait() None

Block until the task is complete. Subclasses may override.

class schrodinger.tasks.v2.base.BaseLoader(runner_id: str)

Bases: _FailureCaptureMixin

Retrieves the output context from the execution environment after completion, using the packer to unpack it if necessary.

Packer = NotImplemented
__init__(runner_id: str)
load() OutputContext | None

Load the output context, capturing any failure.

If _load() raises, the exception is captured as FailureInfo(site=LOADING). If _load() succeeds but the output context carries an execution failure, that failure is forwarded into self._failure_info.

class schrodinger.tasks.v2.base.BaseExecutor

Bases: _FailureCaptureMixin

Unpack an input packet, execute the task’s mainFunction, and pack the output packet.

Packer

alias of InMemoryPacker

__init__()
execute(input_packet) OutputContext

Unpack input_packet, run the task, and return the output packet.

class schrodinger.tasks.v2.base.BaseRunner(task: Task, *, launchdir: PathLike = None, preprocess_handler: BasePreprocessHandler = None)

Bases: object

Launcher = NotImplemented
__init__(task: Task, *, launchdir: PathLike = None, preprocess_handler: BasePreprocessHandler = None)
preprocess() None
start() None
run() None
wait() None
getStatus() Status

Derive status by querying sub-systems in pipeline order.

getFailureInfo() FailureInfo | None

Return the first failure in the sub-system chain.