Projects#

Projects are a selection of training data used to train a model.

Directory#

class ProjectDirectory#

Provides a collection of methods related to projects.

This class is accessed through client.projects.

Example

List all projects:

import ansys.simai.core

simai = ansys.simai.core.from_config()
simai.projects.list()
cancel_build(project: Project | str)#

Cancel a build if one is in progress.

Parameters:

project (Project | str) – ID or model of the project.

create(name: str) Project#

Create a project.

delete(project: Project | str) None#

Delete a project.

Parameters:

project (Project | str) – ID or model of the project.

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

Get a project by either ID or name.

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

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

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

list() List[Project]#

List all projects available on the server.

Model#

class Project#

Provides the local representation of a project object.

cancel_build()#

Cancels a build if there is one pending.

compute_gc_formula(gc_formula: str, bc: list[str] | None = None, surface_variables: list[str] | None = None)#

Compute the result of a global coefficient formula according to the project sample.

delete() None#

Delete the project.

get_variables() Dict[str, List[str]] | None#

Get the available variables for the model’s input/output.

is_trainable() bool#

Check if the project meets the prerequisites to be trained.

reload() None#

Refresh the object with its representation from the server.

verify_gc_formula(gc_formula: str, bc: list[str] | None = None, surface_variables: list[str] | None = None)#

Verify whether the syntax of the global coefficient formula is valid.

property data: List[TrainingData]#

List of all TrainingData instances in the project.

property fields: dict#

Dictionary containing the raw object representation.

property id: str#

ID of the object on the server.

property last_model_configuration: ModelConfiguration#

Last configuration used for model training in this project.

property name: str#

Name of project.

property sample: TrainingData | None#

Sample of the project. The sample determines what variable and settings are available during model configuration.

IsTrainableInfo#

class IsTrainableInfo#

Properties for project’s trainability.

The objects of this class can be used as booleans in condition statements as in the example:

Example

Verify the project is trainable

pt = my_project.is_trainable()

if pt:
    print(pt)

It prints:

<is_trainable: False, reason(s): Not enough data to train a model: we need at least 3 data points to train a model.>
is_trainable#

True if the project is trainable, False if it is not.

Type:

bool

reason#

If not_trainable is False, the reason why the project is not trainable. None otherwise.

Type:

str

Create new instance of IsTrainableInfo(is_trainable, reason)