Parameterized Models#
Manage parameterized models in Ionworks Studio.
For usage examples and guides, see Managing parameterized models on docs.ionworks.com.
Parameterized model client for managing parameterized battery models.
This module provides the ParameterizedModelClient for creating,
reading, and updating parameterized models, which combine a base model with
specific parameter values for a given cell specification.
- class ionworks.parameterized_model.ParameterizedModelClient(client)[source]#
Bases:
objectClient for managing parameterized models.
Parameterized models combine a base model (e.g. SPM, DFN) with specific parameter values for a given cell specification.
- Parameters:
client (Any)
- __init__(client)[source]#
Initialize the ParameterizedModelClient.
- Parameters:
client (Any) – The HTTP client instance for making API requests.
- Return type:
None
- get(parameterized_model_id)[source]#
Get a specific parameterized model by ID.
Uses the non-cell-scoped endpoint so callers don’t need the cell spec ID just to fetch an existing model.
- Parameters:
parameterized_model_id (str) – The ID of the parameterized model to retrieve.
- Returns:
The requested parameterized model object.
- Return type:
- list_by_cell_specification(cell_spec_id, limit=None, offset=None)[source]#
List parameterized models for a cell specification.
- Parameters:
- Returns:
A paginated list of parameterized model objects.
- Return type:
- list_by_project(project_id=None, limit=None, offset=None, *, cell_spec_id=None)[source]#
List parameterized models across all cell specs in a project.
Unlike
list(), which scopes to a single cell specification, this returns every parameterized model linked to any cell specification in the project.- Parameters:
project_id (str | None, optional) – The ID of the project to list models for. Defaults to the project_id set on the Ionworks client.
limit (int | None, optional) – Maximum number of models to return per page.
offset (int | None, optional) – Number of models to skip for pagination.
cell_spec_id (str | None, optional) – If provided, restrict results to a single cell specification within the project. Defaults to None (all cell specs in the project).
- Returns:
A paginated list of parameterized model objects.
- Return type:
- create(cell_spec_id, data)[source]#
Create a new parameterized model for a cell specification.
- Parameters:
cell_spec_id (str) – The ID of the cell specification to create the parameterized model for.
Dictionary containing the parameterized model data. Required fields:
name,model_id. Optional fields:description,parameters,simulation_settings.simulation_settingsis a persistent bag of pybamm simulation kwargs (var_pts/submesh_types/spatial_methods/solver) that takes precedence over the base model’s settings when this parameterized model is simulated. Pass aniws.models.SimulationSettings(...)object (serialized for you) or its config dict (seeModelClient.create()).
- Returns:
The newly created parameterized model object.
- Return type:
- create_or_get(cell_spec_id, data)[source]#
Create a new parameterized model or get an existing one.
Creates a new parameterized model if one with the same name does not already exist for the cell specification, otherwise returns the existing one. This makes setup scripts safely re-runnable, matching the
create_or_getbehaviour of the cell spec, instance, and measurement clients.- Parameters:
- Returns:
The parameterized model object (newly created or existing).
- Return type:
- update(cell_spec_id, parameterized_model_id, data)[source]#
Update a parameterized model’s name, description, or simulation settings.
- Parameters:
cell_spec_id (str) – The ID of the cell specification the model belongs to.
parameterized_model_id (str) – The ID of the parameterized model to update.
data (dict[str, Any]) – Dictionary containing the fields to update. Supports
name,description, andsimulation_settings(aSimulationSettingsobject or its config dict; sendnullto clear the persisted settings and fall back to the base model / defaults).
- Returns:
The updated parameterized model object.
- Return type:
- get_parameter_values(parameterized_model_id)[source]#
Get all parameter values from a parameterized model as JSON.
Returns the complete parameter set, suitable for use as baseline parameters in DataFit, parameterization, or optimization workflows. Version and citation metadata are excluded.