GeomAIProjections#
The Projections module is in charge of projecting
geometries onto
the model of your
workspaces,
which yields the latent vectors that represent their coordinates in the latent
space of the model.
Directory#
- class GeomAIProjectionDirectory#
Provides a collection of methods related to GeomAI projections.
This class is accessed through
client.geomai.projections.Example
import ansys.simai.core as asc simai_client = asc.from_config() simai_client.geomai.projections.list()
- delete(projection: GeomAIProjection | str) None#
Delete a specific GeomAI projection from the server.
- Parameters:
projection (GeomAIProjection | str) – ID or
modelof the projection.- Raises:
NotFoundError – No projection with the given ID exists.
- get(id: str) GeomAIProjection#
Get a specific GeomAI projection object from the server by ID.
- Parameters:
id (str) – ID of the projection.
- Returns:
GeomAIProjectioninstance with the given ID if it exists.- Raises:
NotFoundError – No projection with the given ID exists.
- Return type:
- list(workspace: GeomAIWorkspace | str | None = None, geometry: GeomAIGeometry | str | None = None) List[GeomAIProjection]#
List the projections associated with the model of the specified workspace, or of the configured workspace if none is specified.
- Parameters:
workspace (GeomAIWorkspace | str | None) – ID or
modelof the workspace to list the projections for. This parameter is necessary if no workspace is set for the client.geometry (GeomAIGeometry | str | None) – Optional ID or
modelof a geometry to restrict the listing to.
- Returns:
List of the matching
GeomAIProjectionobjects.- Return type:
- run(geometry: GeomAIGeometry | str, workspace: GeomAIWorkspace | str | None = None) GeomAIProjection#
Project a geometry onto the model of the given workspace.
- Parameters:
geometry (GeomAIGeometry | str) – ID or
modelof the geometry to project.workspace (GeomAIWorkspace | str | None) – ID or
modelof the target workspace. Defaults to the current workspace if set.
- Returns:
The created or existing
GeomAIProjectionobject.- Return type:
Example
import ansys.simai.core as asc simai_client = asc.from_config() workspace = simai_client.geomai.workspaces.get(name="my-workspace") geometry = simai_client.geomai.geometries.upload("my_geometry.vtp") geometry.wait() projection = simai_client.geomai.projections.run(geometry, workspace) projection.wait() print(projection.get_latent_parameters())
Model#
- class GeomAIProjection#
Provides the local representation of a GeomAI projection object.
- get_latent_parameters(n: int | None = None) List[float] | None#
Get the coordinates of the geometry in the latent space of the model.
By default, latent parameters are ordered by importance: the first ones capture the largest sources of variation in the geometry , while later ones capture increasingly finer details.
- Parameters:
n (int | None) – Optional number of latent parameters to retrieve, that is the length of the returned vector. If
None, all latent parameters are returned. Must not exceed the number of latent parameters used for model training.- Returns:
The latent parameters of the geometry, truncated to its first
nvalues ifnis provided.Noneuntil the projection has finished successfully, or if the projection failed.- Raises:
InvalidArguments – If
nexceeds the number of latent parameters used for model training. Note that this check can only be performed once the projection has finished successfully; while the latent parameters isNone,nis not validated.- Return type:
- wait(timeout: float | None = None) bool#
Wait for all jobs concerning the object to either finish or fail.
- property failure_reason#
Optional message giving the causes for why the creation of the object failed.
See also
- property has_failed#
Boolean indicating if the creation of the object failed.
See also
- property is_pending#
Boolean indicating if the object is still in creation. The value becomes
Falseonce object creation is either successful or has failed.See also
- property is_ready#
Boolean indicating if the object has finished creating without error.
See also