plexus.dashboard.api.models.experiment_node_version module

ExperimentNodeVersion Model - Python representation of the GraphQL ExperimentNodeVersion type.

Represents a specific version of an experiment node, containing: - YAML configuration for this version - Computed value (JSON data) - Status tracking (QUEUED, RUNNING, SUCCEEDED, FAILED) - Sequential ordering within the node

Each version belongs to a specific node and experiment, and versions are ordered by their sequence number within each node.

class plexus.dashboard.api.models.experiment_node_version.ExperimentNodeVersion(id: str, experimentId: str, nodeId: str, code: str, createdAt: str, updatedAt: str, value: Dict[str, Any] | None = None, status: str | None = None, hypothesis: str | None = None, insight: str | None = None, client: ForwardRef('_BaseAPIClient') | None = None)

Bases: BaseModel

__init__(id: str, experimentId: str, nodeId: str, code: str, createdAt: str, updatedAt: str, value: Dict[str, Any] | None = None, status: str | None = None, hypothesis: str | None = None, insight: str | None = None, client: _BaseAPIClient | None = None)
code: str
classmethod create(client: _BaseAPIClient, experimentId: str, nodeId: str, code: str, status: str | None = None, hypothesis: str | None = None, insight: str | None = None, value: Dict[str, Any] | None = None) ExperimentNodeVersion

Create a new experiment node version.

Args:

client: The API client experimentId: ID of the experiment this version belongs to nodeId: ID of the node this version belongs to code: Code configuration content (YAML/JSON) value: Computed value (will be JSON-serialized, optional) status: Version status (optional) hypothesis: Hypothesis for this version (optional) insight: Insight for this version (optional)

Returns:

The created ExperimentNodeVersion instance

createdAt: str
delete() bool

Delete this experiment node version.

Returns:

True if deletion was successful

experimentId: str
classmethod fields() str

Return the GraphQL fields to query for this model

classmethod from_dict(data: Dict[str, Any], client: _BaseAPIClient) ExperimentNodeVersion

Create an instance from a dictionary of data

get_computed_value() Dict[str, Any]

Get the computed value for this version.

Returns:

The computed value as a dictionary

classmethod get_latest_by_node(nodeId: str, client: _BaseAPIClient) ExperimentNodeVersion | None

Get the latest version for a node (most recent by createdAt).

Args:

nodeId: The node ID to get the latest version for client: The API client instance

Returns:

The latest ExperimentNodeVersion or None if no versions exist

get_node() ExperimentNode | None

Get the node this version belongs to.

Returns:

The ExperimentNode this version belongs to, or None if not found

get_yaml_config() str

Get the code configuration for this version.

Returns:

The code configuration string

hypothesis: str | None
insight: str | None
is_completed() bool

Check if this version has completed (succeeded or failed).

Returns:

True if status is SUCCEEDED or FAILED

is_queued() bool

Check if this version is queued for execution.

Returns:

True if status is QUEUED

is_running() bool

Check if this version is currently running.

Returns:

True if status is RUNNING

classmethod list_by_node(nodeId: str, client: _BaseAPIClient, limit: int = 100) List[ExperimentNodeVersion]

List versions for a node, ordered by creation time descending (latest first).

Args:

nodeId: The node ID to filter by client: The API client instance limit: Maximum number of versions to return

Returns:

List of ExperimentNodeVersion instances ordered by createdAt descending

mark_failed(error_info: Dict[str, Any] | None = None) ExperimentNodeVersion

Mark this version as failed.

Args:

error_info: Optional error information to include in the value

Returns:

Updated ExperimentNodeVersion instance

mark_running() ExperimentNodeVersion

Mark this version as running.

Returns:

Updated ExperimentNodeVersion instance

mark_succeeded(final_value: Dict[str, Any] | None = None) ExperimentNodeVersion

Mark this version as succeeded.

Args:

final_value: Optional final computed value to set

Returns:

Updated ExperimentNodeVersion instance

nodeId: str
status: str | None
update(status: str | None = None, yaml: str | None = None, value: Dict[str, Any] | None = None) ExperimentNodeVersion

Update this experiment node version.

Args:

status: New status (‘QUEUED’, ‘RUNNING’, ‘SUCCEEDED’, ‘FAILED’) yaml: New YAML configuration value: New computed value (will be JSON-serialized)

Returns:

Updated ExperimentNodeVersion instance

updatedAt: str
value: Dict[str, Any] | None