GeomAIWorkspaces#

Workspaces are a set of specific predictions. Each workspace uses a specific model.

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

Directory#

class GeomAIWorkspaceDirectory#

Provides a collection of methods related to GeomAI workspaces.

This class is accessed through client.geomai.workspaces.

Example

import ansys.simai.core as asc

simai_client = asc.from_config()
simai_client.geomai.workspaces.list()
create(name: str, project: GeomAIProject | str, description: str | None = None) → GeomAIWorkspace#

Create a workspace.

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

  • project (GeomAIProject | str) – ID or project of the workspace.

  • description (str | None) – Optional description for the workspace.

delete(workspace: GeomAIWorkspace | str) → None#

Delete a workspace.

Parameters:

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

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

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:

A GeomAIWorkspace.

Raises:

NotFoundError – No workspace with the given ID exists.

Return type:

GeomAIWorkspace

iter(filters: dict[str, Any] | list[tuple[str, Literal['EQ', 'LIKE', 'IN', 'GT', 'GTE', 'LT', 'LTE'], Any]] | list[RawSingleFilter] | None = None) → SizedIterator[GeomAIWorkspace]#

Iterate over all GeomAIWorkspace objects the server.

Parameters:

filters (dict[str, Any] | list[tuple[str, Literal['EQ', 'LIKE', 'IN', 'GT', 'GTE', 'LT', 'LTE'], ~typing.Any]] | list[~ansys.simai.core.data.types.RawSingleFilter] | None) – Optional Filters to apply.

Returns:

Iterator over all GeomAIWorkspace objects on the server.

Return type:

SizedIterator[GeomAIWorkspace]

list(filters: dict[str, Any] | list[tuple[str, Literal['EQ', 'LIKE', 'IN', 'GT', 'GTE', 'LT', 'LTE'], Any]] | list[RawSingleFilter] | None = None, created_by_me: bool | None = None) → List[GeomAIWorkspace]#

List all workspaces from the server.

Model#

class GeomAIWorkspace#

Provides the local representation of a GeomAI workspace object.

delete()#

Delete the workspace.

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

Download the JSON file containing the latent parameters for the model’s training data.

Warning

This feature was decommissioned. Please use get_latent_parameters() instead.

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

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

Download the ZIP file 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

get_latent_parameters(file: BinaryIO | RawIOBase | BufferedIOBase | Path | str | PathLike | None = None, n: int | None = None) → dict[str, List[float]] | None | BinaryIO#

Get the mapping between geometry names and their latent parameter vectors for the model’s training data.

By default, latent parameters are ordered by importance: the first ones capture the largest sources of variation in the training data, while later ones capture increasingly finer details.

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

  • n (int | None) – Optional number of latent parameters to retrieve per geometry (i.e., the length of the returned vector). If None, all latent parameters are returned. If specified, each vector is truncated to the first n elements. Must not exceed the number of latent parameters used for model training.

Returns:

None or a binary file-object if a file is specified or a dictionary mapping geometry names to latent parameter vectors otherwise.

Raises:

InvalidArguments – If n exceeds the number of latent parameters used for model training.

Return type:

dict[str, List[float]] | None | BinaryIO

list_predictions() → List[GeomAIPrediction]#

Lists all the predictions in the workspace.

list_projections() → List[GeomAIProjection]#

List all the projections associated to the model of the workspace.

reload() → None#

Refresh the object with its representation from the server.

rename(new_name: str) → None#

Rename the workspace.

Parameters:

new_name (str) – New name to give to the workspace.

set_as_current_workspace() → None#

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

set_description(new_description: str | None) → None#

Set the workspace description.

Parameters:

new_description (str | None) – New description for the workspace.

property description: str | None#

Description of the workspace.

property fields: dict#

Dictionary containing the raw object representation.

property id: str#

ID of the object on the server.

property model_configuration: GeomAIModelConfiguration#

Model configuration used in the workspace.

property model_manifest: GeomAIModelManifest#

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

Raises:

NotFoundError – If the workspace’s model has no manifest, which is the case for models built before manifests were introduced.

property name: str#

Name of the workspace.

GeomAIModelManifest#

class GeomAIModelManifest#

Provides information about a model associated with a GeomAI workspace.

property build_preset: str | None#

Build preset used to train the model, or None if no build preset was used.

property name: str#

Name of the model.

property nb_epochs: int#

Number of epochs the model actually used to train the model.

property nb_latent_parameters: int#

Number of latent parameters of the model.

property requested_nb_epochs: int#

Number of epochs requested for the model training.