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.

When progressReport is a v2 execution tree (root node with displayName and status), the card body renders an indented HTML/SVG tree via :func:~deeporigin.platform.progress_tree_display.render_progress_tree_html: status-colored nodes, optional SVG completion rings from toolProgress.complete, and expandable error details on failed steps. Legacy shapes (flat {"complete": n} or batched workflow keys) keep the Bootstrap horizontal progress bar while status is Running.

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.

workflow_subjob_completes tuple[float, ...]

Per-workflow complete values when batch keys exist; used to render one progress bar per child. Empty when not a workflow batch.

progress_report dict | str | None

Raw progressReport from the execution DTO, when present.

Attributes

complete instance-attribute

complete: float | int

execution_id instance-attribute

execution_id: str | None

name instance-attribute

name: str | None

progress_report class-attribute instance-attribute

progress_report: dict | str | None = 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

workflow_subjob_completes class-attribute instance-attribute

workflow_subjob_completes: tuple[float, ...] = ()

Methods:

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

When progress_report is a v2 tree, the tree is shown for all statuses. Otherwise the Bootstrap progress bar is shown only when :attr:status is "Running".