deeporigin.drug_discovery.execution_mixins¶
Mixins composed with :class:deeporigin.drug_discovery.execution.Execution to
add synchronous run() or async lifecycle control (start, cancel).
Quoting, confirm(), :attr:~deeporigin.drug_discovery.execution.Execution.runtime,
:meth:~deeporigin.drug_discovery.execution.Execution.sync, and platform id /
dto live on :class:deeporigin.drug_discovery.execution.Execution. After quote(),
a tools execution is typically in "Quoted" status. :meth:Execution.confirm
calls the tools :confirm endpoint (same long timeout and no-retries policy
as :data:~deeporigin.utils.constants.TOOL_EXECUTION_POST_TIMEOUT_SECONDS on
:class:~deeporigin.platform.executions.Executions.confirm). Async classes call
this from :meth:AsyncExecutableMixin.start when resuming a quoted job that was
quoted with mode="async", then calls :meth:~deeporigin.drug_discovery.execution.Execution.sync.
Mixins that compose execution capabilities for job classes.
These mixins are combined with Execution to build concrete types:
SyncExecutableMixin-- blocking execution viarun()AsyncExecutableMixin-- async, stateful execution viastart()andcancel()(platform refresh uses :meth:~deeporigin.drug_discovery.execution.Execution.syncon the base class)NotebookWatchMixin-- live Jupyter HTML polling viawatch_async()(seedeeporigin.drug_discovery.notebook_watch_mixin)
Both run() and start() accept quote=True (sugar for
approve_amount=0) and an explicit approve_amount. If the platform returns
a Quoted DTO the instance is left in that state with no automatic
confirmation. confirm(), :meth:~deeporigin.drug_discovery.execution.Execution.sync,
and :attr:~deeporigin.drug_discovery.execution.Execution.runtime live on
:class:~deeporigin.drug_discovery.execution.Execution.
Classes¶
AsyncExecutableMixin
¶
Adds start() and cancel() for asynchronous, stateful execution
backed by the platform tools API.
Platform state refresh uses :meth:~deeporigin.drug_discovery.execution.Execution.sync
(inherited from :class:~deeporigin.drug_discovery.execution.Execution), so
sync-only execution types can poll the same way after an id exists.
Listing and rehydration use :meth:~deeporigin.drug_discovery.execution.Execution.list,
:meth:~deeporigin.drug_discovery.execution.Execution.from_id, and
:meth:~deeporigin.drug_discovery.execution.Execution.from_dto on the
composed class (subclasses override from_dto and call super()).
Classes that include this mixin gain status and progress attributes
tracking the platform lifecycle and execution progress respectively. Elapsed
time is available on :class:~deeporigin.drug_discovery.execution.Execution
via :attr:~deeporigin.drug_discovery.execution.Execution.runtime.
Attributes¶
Functions¶
cancel
¶
cancel() -> None
Cancel a running or queued execution.
Raises:
| Type | Description |
|---|---|
ValueError
|
If the job has no execution ID. |
ValueError
|
If the job is not in a cancellable state. |
start
¶
start(
*,
quote: bool = False,
approve_amount: int | None = None,
**kwargs
) -> None
Submit a persisted async execution to the platform.
Only valid when status is None (no execution exists yet).
All other statuses raise immediately to prevent re-submission.
Pass quote=True or approve_amount=0 to request a cost estimate
without running. If the platform returns a Quoted DTO the instance
is left in that state — call :meth:~deeporigin.drug_discovery.execution.Execution.confirm
explicitly to proceed.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
quote
|
bool
|
Shorthand for |
False
|
approve_amount
|
int | None
|
Spend cap passed to the platform as |
None
|
**kwargs
|
Forwarded verbatim to |
{}
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If the current status is not |
SyncExecutableMixin
¶
Adds run() for synchronous, blocking execution.
Subclasses implement run() as a blocking call. For tools backed by
client.executions.create with sync=True, the response is typically a
completed execution DTO that includes executionId and billing fields.
Other subclasses may call legacy synchronous APIs instead; behaviour is
defined per class.