Skip to content

Execution display (notebook HTML)

Jupyter helpers such as :class:~deeporigin.drug_discovery.notebook_watch_mixin.NotebookWatchMixin render execution state using :class:~deeporigin.platform.execution_display.ExecutionDisplay — a small Bootstrap card with progress and metadata, without the legacy Job widget.

src.platform.execution_display.ExecutionDisplay dataclass

Display model for a single platform execution in Jupyter HTML.

Attributes:

Name Type Description
complete float | int

Progress 0–100 from progressReport; 0 means an indeterminate bar when :attr:status is "Running" (the bar is hidden for other statuses).

execution_id str | None

Platform execution UUID string, or None if nothing has been submitted.

name str | None

Optional user label from the execution.

status str

Lifecycle status (see :data:~deeporigin.platform.constants.PlatformStatus).

tool_key str | None

Platform tool identifier from the execution DTO, if known.

tool_version str | None

Tool version string from the execution DTO, if known.

workflow_child_count int

Number of progressReport top-level keys whose names contain workflow (child executions in a workflow batch); 0 if none.

Attributes

complete instance-attribute

complete: float | int

execution_id instance-attribute

execution_id: str | None

name instance-attribute

name: str | None

status instance-attribute

status: str

tool_key class-attribute instance-attribute

tool_key: str | None = None

tool_version class-attribute instance-attribute

tool_version: str | None = None

workflow_child_count class-attribute instance-attribute

workflow_child_count: int = 0

Functions

from_dto classmethod

from_dto(dto: dict) -> Self

Build an :class:ExecutionDisplay from a tools API execution DTO.

Parameters:

Name Type Description Default
dto dict

Execution dict with at least executionId and status.

required

Returns:

Type Description
Self

Populated display model.

Raises:

Type Description
ValueError

If executionId is missing.

from_pending classmethod

from_pending(
    *,
    name: str | None,
    status: str | None,
    tool_key: str | None = None,
    tool_version: str | None = None
) -> Self

Build a display for an object that has not received a platform execution ID yet.

Parameters:

Name Type Description Default
name str | None

Optional user label (e.g. from :class:~deeporigin.drug_discovery.execution.Execution).

required
status str | None

Current lifecycle status, or None before any lifecycle state.

required
tool_key str | None

Optional tool key (e.g. from the execution class tool_key).

None
tool_version str | None

Optional tool version (e.g. from tool_version).

None

Returns:

Type Description
Self

Display model with status defaulting to "New" when missing.

render_html

render_html(*, will_auto_update: bool = False) -> str

Render a self-contained Bootstrap 5 card HTML fragment.

Parameters:

Name Type Description Default
will_auto_update bool

If True, show a live-update hint in the footer.

False

Returns:

Type Description
str

HTML string safe for :class:IPython.display.HTML.

Note

The progress bar is rendered only when :attr:status is "Running".