ProjectClient¶
- class pystclient.clients.ProjectClient(session: Session, model_client: ModelClient)¶
Bases:
BaseClientClient for managing STC projects and their associated configurations.
Provides methods for creating, deleting, and inspecting projects, as well as managing their FMU model selections, parameter sets, variable connections, logging configuration, and completed simulation history.
- __init__(session: Session, model_client: ModelClient) None¶
Methods
__init__(session, model_client)completed_simulations(project_id[, ...])Retrieve the history of completed simulations for a project.
completed_simulations_by_batch_id(...[, limit])Retrieve completed simulations that belong to a specific batch.
connections(project_id)Retrieve the FMU connection graph for a project.
create(model)Create a new project on the STC platform.
create_connections(project_id, conns)Define the FMU connection graph for a project.
current_simulators(project_id)List all simulators that are currently active for a project.
delete(project_id)Permanently delete a project and all its associated data from the platform.
delete_parameters(project_id, *parameter_names)Remove named parameter sets from a project's configuration.
deselect_all_models(project_id)Remove all FMU model assignments from a project.
fmu_variables(project_id)List all input, output, and parameter variables for every FMU model in a project.
fmus(project_id)List the FMU models currently assigned to a project.
info(project_id)Retrieve detailed metadata for a single project.
info_all()List metadata for all projects accessible to the authenticated user.
log_config(project_id)Retrieve the current logging configuration for a project.
parameter(project_id, config_name)Retrieve a single named parameter set from a project.
parameter_names(project_id)List the names of all parameter sets defined in a project.
parameters(project_id)Retrieve all parameter sets configured for a project.
parameters_including_causality(project_id)Retrieve simulation parameters with variables classified by causality.
select_models(project_id, fmu_models)Assign one or more FMU models to a project for use in simulations.
update_log_config(project_id, log_config)Replace the logging configuration for a project.
update_parameters(project_id, ...)Merge new or modified simulation parameters into a project's existing configuration.
Attributes
session- completed_simulations(project_id: str | UUID, simulator_ids: Sequence[Annotated[str | UUID, PlainSerializer(func=str, return_type=str, when_used=always)]] | None = None, limit: int = 10) list[SimulationInfo]¶
Retrieve the history of completed simulations for a project.
Returns metadata for finished simulation runs, optionally filtered to only those executed by specific simulators.
- Parameters:
project_id – ID of the project whose simulation history to query
simulator_ids – If provided, only return simulations run by these simulators
limit – Maximum number of results to return from the API, by default 10
- Returns:
Metadata for each matching completed simulation
- completed_simulations_by_batch_id(project_id: str | UUID, batch_id: Annotated[str | UUID, PlainSerializer(func=str, return_type=str, when_used=always)], limit: int = 10) list[SimulationInfo]¶
Retrieve completed simulations that belong to a specific batch.
A batch groups multiple simulations that were started together. This method fetches recent completed simulations and filters them to those matching the given
batch_id.- Parameters:
project_id – ID of the project to query
batch_id – Batch identifier to filter by
limit – Maximum number of completed simulations to fetch before filtering, by default 10
- Returns:
Completed simulations belonging to the specified batch
- connections(project_id: str | UUID) FmuConnections¶
Retrieve the FMU connection graph for a project.
The connection graph describes how FMU model instances are wired together — which output variables feed into which input variables.
- Parameters:
project_id – ID of the project whose connections to retrieve
- Returns:
The project’s connection graph including nodes (model instances) and edges (variable connections)
- create(model: BaseProject) ProjectInformation¶
Create a new project on the STC platform.
- Parameters:
model – Project definition including name and optional settings
- Returns:
Metadata of the newly created project, including its assigned ID
- create_connections(project_id: str | UUID, conns: FmuConnections) bool¶
Define the FMU connection graph for a project.
Resolves each node in the connection graph to its FMU model, fetches variable metadata, validates that connected variables have compatible types, and uploads the complete graph to the project.
- Parameters:
project_id – ID of the project to configure connections for
conns – Connection graph describing model instances (nodes) and the variable wiring between them (edges)
- Returns:
Trueif the server accepted the connection configuration- Raises:
FmuModelNotFoundError – If a node references an FMU model that cannot be found
MissingVariablesError – If an edge references variables that do not exist on the connected models
- current_simulators(project_id: str | UUID) list[SimulatorStatus]¶
List all simulators that are currently active for a project.
Returns status information for simulators that have been created but not yet terminated or cleaned up.
- Parameters:
project_id – ID of the project whose active simulators to list
- Returns:
Status snapshots for each currently active simulator
- delete(project_id: str | UUID) bool¶
Permanently delete a project and all its associated data from the platform.
- Parameters:
project_id – ID of the project to delete
- Returns:
Trueif the server accepted the deletion request
- delete_parameters(project_id: str | UUID, *parameter_names: str) bool¶
Remove named parameter sets from a project’s configuration.
If specific names are given, only those sets are removed. If all parameter sets are deleted, a default
"Config 1"placeholder is created. When called with no names, all parameters are cleared.- Parameters:
project_id – ID of the project to modify
*parameter_names – Names of the parameter sets to delete
- Returns:
Trueif the server accepted the deletion
- deselect_all_models(project_id: str | UUID) bool¶
Remove all FMU model assignments from a project.
After this call the project will have no models selected and cannot start new simulations until models are re-assigned with
select_models().- Parameters:
project_id – ID of the project to clear model selections from
- Returns:
Trueif the deselection was accepted by the server
- fmu_variables(project_id: str | UUID) list[FmuVariables]¶
List all input, output, and parameter variables for every FMU model in a project.
- Parameters:
project_id – ID of the project whose FMU variables to retrieve
- Returns:
Variable definitions grouped by FMU model
- fmus(project_id: str | UUID) list[FmuModelInformation]¶
List the FMU models currently assigned to a project.
- Parameters:
project_id – ID of the project whose assigned models to retrieve
- Returns:
Metadata for each FMU model selected in the project
- info(project_id: str | UUID) ProjectInformation¶
Retrieve detailed metadata for a single project.
- Parameters:
project_id – Unique identifier of the project
- Returns:
Project metadata including name, creation date, and configuration
- info_all() list[ProjectInformation]¶
List metadata for all projects accessible to the authenticated user.
- Returns:
Metadata for every available project
- log_config(project_id: str | UUID) LoggingConfiguration¶
Retrieve the current logging configuration for a project.
The logging configuration controls which variables and at what frequency data is recorded during simulations.
- Parameters:
project_id – ID of the project to retrieve logging configuration for
- Returns:
The project’s current logging settings
- parameter(project_id: str | UUID, config_name: str) SimulationParameters¶
Retrieve a single named parameter set from a project.
Use
parameter_names()to discover available set names.- Parameters:
project_id – ID of the project
config_name – Name of the parameter set to retrieve
- Returns:
The requested parameter configuration
- parameter_names(project_id: str | UUID) list[str]¶
List the names of all parameter sets defined in a project.
These names can be used with
parameter()to fetch individual parameter configurations.- Parameters:
project_id – ID of the project
- Returns:
Names of the available parameter sets
- parameters(project_id: str | UUID) list[SimulationParameters]¶
Retrieve all parameter sets configured for a project.
- Parameters:
project_id – ID of the project
- Returns:
Every parameter configuration defined in the project
- parameters_including_causality(project_id: str | UUID) list[SimulationParameters]¶
Retrieve simulation parameters with variables classified by causality.
Fetches the project’s FMU variables, connection topology, and parameter configurations, then categorizes each variable as an input, output, or parameter based on its causality in the FMU model description.
- Parameters:
project_id – ID of the project
- Returns:
Parameter configurations with variables sorted into
inputs,outputs, andparameterslists
- select_models(project_id: str | UUID, fmu_models: list[FmuSelect]) bool¶
Assign one or more FMU models to a project for use in simulations.
Model version and ID are resolved automatically from the API if not already set on the provided
FmuSelectobjects.- Parameters:
project_id – ID of the project to assign models to
fmu_models – FMU model selectors identifying which models to assign
- Returns:
Trueif the models were successfully assigned
- update_log_config(project_id: str | UUID, log_config: LoggingConfiguration) bool¶
Replace the logging configuration for a project.
Overwrites the project’s existing logging settings with the provided configuration. This affects which variables are recorded in future simulation runs.
- Parameters:
project_id – ID of the project to update
log_config – New logging configuration to apply
- Returns:
Trueif the server accepted the update
- update_parameters(project_id: str | UUID, *simulation_parameters: SimulationParameters) bool¶
Merge new or modified simulation parameters into a project’s existing configuration.
Fetches the current parameter sets (with causality), merges the provided parameters (new values take precedence), serializes the result as EDN, and uploads it to the project.
- Parameters:
project_id – ID of the project to update
*simulation_parameters – One or more parameter sets to merge into the project
- Returns:
Trueif the server accepted the update
- model_client: ModelClient¶