Workspaces#

Workspaces are a set of specific geometries, predictions, and postprocessings. Each workspace uses a specific kernel.

You use the SimAIClient.set_current_workspace() method to set the workspace that the client is configured for.

Directory#

class WorkspaceDirectory#

Provides a collection of methods related to workspaces.

This class is accessed through client._workspaces.

Example

import ansys.simai.core

simai = ansys.simai.core_from_config()
simai.workspaces.list()
create(name: str, model_id: str) Workspace#

Create a workspace.

Parameters:
  • name (str) – Name to give the new workspace.

  • model_id (str) – ID of the model for the workspace to use.

delete(workspace: Workspace | str) None#

Delete a workspace.

Parameters:

workspace (Workspace | str) – ID or model of the workspace.

get(id: str | None = None, name: str | None = None) Workspace#

Get a specific workspace object from the server by either ID or name.

You can specify either the ID or the name, not both.

Parameters:
  • id (str | None) – ID of the workspace.

  • name (str | None) – Name of the workspace.

Returns:

Workspace.

Raises:

NotFoundError – No geometry with the given ID exists.

Return type:

Workspace

list() List[Workspace]#

List all workspaces from the server.

Model#

class Workspace#

Provides the local representation of a workspace object.

delete()#

Delete the workspace.

download_model_evaluation_report(file: BinaryIO | RawIOBase | BufferedIOBase | Path | str | PathLike | None = None) None | BinaryIO#

Download the PDF of the model evaluation report for the workspace.

Parameters:

file (BinaryIO | RawIOBase | BufferedIOBase | Path | str | PathLike | None) – Binary file-object or the path of the file to put the content into.

Returns:

None if a file is specified or a binary file-object otherwise.

Return type:

None | BinaryIO

reload() None#

Refresh the object with its representation from the server.

set_as_current_workspace() None#

Configure the client to use this workspace instead of the one currently configured.

property fields: dict#

Dictionary containing the raw object representation.

property id: str#

ID of the object on the server.

property model: ModelManifest#

ModelManifest instance containing information about the model associated with the workspace.

property name: str#

Name of the workspace.

ModelManifest#

class ModelManifest#

Provides information about a model associated with a workspace.

property boundary_conditions: Dict[str, Any]#

Information on the boundary conditions expected by the model. For example, the prediction’s input.

property description: str#

Short description of the model.

property geometry: Dict[str, Any]#

Information on the geometry format expected by the model.

property name: str#

Name of the model.

property physical_quantities: Dict[str, Any]#

Information on the physical quantities generated by the model. For example, the prediction’s output.

property post_processings: List[Dict[str, Any]]#

Information on the postprocessings available for the model and the accepted parameters when relevant.

property version: str#

Version of the software running the model.