Skip to content

Workspace

For working with LynxKite workspaces.

Workspace ¤

Bases: BaseConfig

A workspace is a representation of a computational graph that consists of nodes and edges.

Each node represents an operation or task, and the edges represent the flow of data between the nodes. Each workspace is associated with an environment, which determines the operations that can be performed in the workspace and the execution method for the operations.

add_edge ¤

add_edge(source: WorkspaceNode, sourceHandle: str, target: WorkspaceNode, targetHandle: str)

For convenience in e.g. tests.

add_node ¤

add_node(func=None, **kwargs)

For convenience in e.g. tests.

load staticmethod ¤

load(path: str) -> Workspace

Load a workspace from a file.

After loading the workspace, the metadata of the workspace is updated.

PARAMETER DESCRIPTION
path

The path to the file to load the workspace from.

TYPE: str

RETURNS DESCRIPTION
Workspace

The loaded workspace object, with updated metadata.

TYPE: Workspace

save ¤

save(path: str)

Persist the workspace to a local file in JSON format.

update_metadata ¤

update_metadata()

Update the metadata of this workspace.

The metadata is the information about the operations that the nodes in the workspace represent, like the parameters and their possible values. This information comes from the catalog of operations for the environment of the workspace.

WorkspaceNode ¤

Bases: BaseConfig

publish_error ¤

publish_error(error: Exception | str | None)

Can be called with None to clear the error state.

publish_result ¤

publish_result(result: Result)

Sends the result to the frontend. Call this in an executor when the result is available.

publish_started ¤

publish_started()

Notifies the frontend that work has started on this node.