GeomAITrainingData#
A GeomAITrainingData instance is a
collection of GeomAITrainingDataPart
instances representing a geometry that can be used as input for the training of models.
In most cases it will contain a single part: the geometry to train on.
The formats supported as input are .vtp and .stl.
The geometry used as input must be:
watertight geometry.
manifold geometry.
It must not intersect with itself (no self-penetration).
Directory#
- class GeomAITrainingDataDirectory#
Provides a collection of methods related to training data.
This class is accessed through
client.training_data.Example
List all of the GeomAI training data:
import ansys.simai.core simai = ansys.simai.core.from_config() simai.geomai.training_data.list()
- create(name: str, project: GeomAIProject | str | None = None) GeomAITrainingData#
Create an empty
GeomAITrainingDataobject.- Parameters:
name (str) – Name to give the new
GeomAITrainingDataobject.project (GeomAIProject | str | None) –
Projectobject to associate the data with.
- Returns:
Created
GeomAITrainingDataobject.- Return type:
See also
create_from_file()handles all the creation of training data and parts for you
- create_from_file(file: Path | str | PathLike | Tuple[BinaryIO | RawIOBase | BufferedIOBase | Path | str | PathLike, str], project: GeomAIProject | str | None = None, monitor_callback: Callable[[int], None] | None = None) GeomAITrainingData#
Convenience function to create a
GeomAITrainingDataobject from a file.- Parameters:
file (Path | str | PathLike | Tuple[BinaryIO | RawIOBase | BufferedIOBase | Path | str | PathLike, str]) –
NamedFileto upload.project (GeomAIProject | str | None) – Optional project to attach the training data to. Defaults to the configured project if any.
monitor_callback (Callable[[int], None] | None) – Optional callback for monitoring the progress of the download. For more information, see the
MonitorCallbackobject.
- delete(training_data: GeomAITrainingData | str) None#
Delete a
GeomAITrainingDataobject and its associated parts from the server.- Parameters:
training_data (GeomAITrainingData | str) – ID or
modelobject of theGeomAITrainingDataobject.
- get(id) GeomAITrainingData#
Get a specific
GeomAITrainingDataobject from the server.- Parameters:
id – ID of the training data
- Returns:
- Raises:
NotFoundError – No training data with the given ID exists.
- Return type:
- iter(filters: dict[str, Any] | list[tuple[str, Literal['EQ', 'LIKE', 'IN', 'GT', 'GTE', 'LT', 'LTE'], Any]] | list[RawSingleFilter] | None = None) SizedIterator[GeomAITrainingData]#
Iterate over all
GeomAITrainingDataobjects on the server.
- list(filters: dict[str, Any] | list[tuple[str, Literal['EQ', 'LIKE', 'IN', 'GT', 'GTE', 'LT', 'LTE'], Any]] | list[RawSingleFilter] | None = None) List[GeomAITrainingData]#
List all
GeomAITrainingDataobjects on the server.Warning
This can take a very long time, consider using
iter()instead.
- upload_part(training_data: GeomAITrainingData | str, file: Path | str | PathLike | Tuple[BinaryIO | RawIOBase | BufferedIOBase | Path | str | PathLike, str], monitor_callback: Callable[[int], None] | None = None) GeomAITrainingDataPart#
Add a part to a
GeomAITrainingDataobject.- Parameters:
training_data (GeomAITrainingData | str) – ID or
modelobject of the training data to add the part to.file (Path | str | PathLike | Tuple[BinaryIO | RawIOBase | BufferedIOBase | Path | str | PathLike, str]) –
NamedFileto upload.monitor_callback (Callable[[int], None] | None) – Optional callback for monitoring the progress of the upload. For more information, see the
MonitorCallbackobject.
- Returns:
Added
GeomAITrainingDataPartobject.- Return type:
Model#
- class GeomAITrainingData#
Provides the local representation of a training data object.
- add_to_project(project: GeomAIProject | str)#
Add the training data to a
GeomAIProjectobject.- Parameters:
project (GeomAIProject | str) – ID or
modelobject of the project to add the data to.
- extract_data() None#
Extract or reextract the data from a training data.
Data should be extracted from a training data once all its parts have been fully uploaded. This is done automatically when using
GeomAITrainingDataDirectory.create_from_file()to create training data.Data can only be reextracted from a training data if the extraction previously failed or if new files have been added.
- remove_from_project(project: GeomAIProject | str)#
Remove the training data from a
GeomAIProjectobject.- Parameters:
project (GeomAIProject | str) – ID or
modelof the project to remove data from.- Raises:
ansys.simai.core.errors.ApiClientError – If the data is the project’s sample.
ansys.simai.core.errors.ApiClientError – If the project is in training.
- upload_part(file: Path | str | PathLike | Tuple[BinaryIO | RawIOBase | BufferedIOBase | Path | str | PathLike, str], monitor_callback: Callable[[int], None] | None = None) GeomAITrainingDataPart#
Add a part to the training data.
- Parameters:
- Returns:
Created
GeomAITrainingDataPart.- 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
- property parts: List[GeomAITrainingDataPart]#
List of all
partsobjects in the training data.