Client#

class SimAIClient(**kwargs)#

Provides the client for communicating with the SimAI API.

For keyword arguments, see the ClientConfig class.

Example

from ansys.simai.core import SimAIClient

simai = SimAIClient(
    organization="company_name", https_proxy="http://company_proxy:3128"
)
classmethod from_config(profile: str = 'default', path: Path | str | PathLike | None = None, **kwargs) SimAIClient#

Initializes a SimAI client by reading a configuration file.

You can provide the path of the configuration file to load. If no path is given, this method looks at the default locations.

For more information, see Configuration file.

You can use kwargs to override part of the configuration.

Parameters:
  • profile (str) – Profile to load from the configuration file. The default profile is loaded if no profile is provided.

  • path (Path | str | PathLike | None) – Path for the configuration file.

  • **kwargs – Additional arguments to pass to the SimAI client.

Returns:

Configured client.

Raises:
Return type:

SimAIClient

Example

Create the client after setting up your configuration file..

import ansys.simai.core

simai = ansys.simai.core.from_config()

Note

The default paths are only supported on Unix systems.

set_current_project(name: str)#

Set the current project for the SimAI client.

This method affects how some methods related to projects or associated data behave.

Parameters:

name (str) – Name of the project that the client should switch to.

set_current_workspace(name: str)#

Set the current workspace for the SimAI client.

Parameters:

name (str) – Name of the workspace that the client should switch to.

Example

import ansys.simai.core

simai = ansys.simai.core.from_config(workspace="old plane")
simai.geometries.list()  # will list geometries belonging to the "old plane" workspace
simai.set_current_workspace("new plane")
simai.geometries.list()  # will list geometries belonging to the "new plane" workspace
wait() None#

Wait for all ongoing operations on locally known predictions and postprocessings to finish.

Raises:
  • SimAIError – If something went wrong on an operation.

  • MultipleErrors – If things went wrong on multiple operations.

property current_project: Project#

Project currently used by the SimAPI client.

Note

You should not set the project directly. Instead, use the set_current_project() method, which uses the project name and ensures that the project exists.

property current_workspace: Workspace#

Workspace currently used by the SimAI client.

Note

You should not set the workspace directly. Instead, use the set_current_workspace() method, which uses the workspace name and ensures that the workspace exists.

property geometries#

Representation of all geometries on the server. For more information, see Geometries.

property models#

Representation of all models on the server. For more information, see Models.

property optimizations#

Representation of all optimizations on the server. For more information, see Optimization.

property post_processings#

Representation of all postprocessings on the server. For more information, see Postprocessings.

property predictions#

Representation of all predictions on the server. For more information, see Predictions.

property projects#

Representation of all projects on the server. For more information, see Projects.

property training_data#

Representation of all training data on the server. For more information, see TrainingData.

property training_data_parts#

Representation of all training data parts on the server. For more information, see TrainingDataParts.

property workspaces#

Representation of all workspaces on the server. For more information, see Workspaces.