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
preprocesshas been called.
- preprocess(task: Task) bool¶
Return whether all preprocessors passed.
Exceptions raised by individual preprocessor methods are captured as
FailureInforather than propagated.
- handleWarning(result: ProcessingResult) bool¶
- handleError(result: ProcessingResult) None¶
- class schrodinger.tasks.v2.base.BaseLauncher(runner_id: str, task: Task)¶
Bases:
_FailureCaptureMixinCreates an input context from the task, packs it using the packer, and sends the resulting packet to the execution environment.
- Packer = NotImplemented¶
- launch(watcher: BaseWatcher) None¶
Build the input packet and launch. Failures are captured.
- class schrodinger.tasks.v2.base.BaseWatcher¶
Bases:
objectMonitors a running task and invokes callbacks on completion and progress changes.
- __init__()¶
- getFailureInfo() FailureInfo | None¶
Return failure information, or
Noneif 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:
_FailureCaptureMixinRetrieves 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 asFailureInfo(site=LOADING). If_load()succeeds but the output context carries an execution failure, that failure is forwarded intoself._failure_info.
- class schrodinger.tasks.v2.base.BaseExecutor¶
Bases:
_FailureCaptureMixinUnpack 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¶
- getFailureInfo() FailureInfo | None¶
Return the first failure in the sub-system chain.