Cell Instance#
Client for managing cell instances.
For usage examples and guides, see Data API on docs.ionworks.com.
Cell instance client for managing individual cell records.
This module provides the CellInstanceClient for creating, reading,
updating, and deleting cell instances, which represent individual physical
battery cells linked to a cell specification.
- class ionworks.cell_instance.CellInstanceClient(client)[source]#
Bases:
objectClient for managing cell instances.
- Parameters:
client (Any)
- __init__(client)[source]#
Initialize the CellInstanceClient.
- Parameters:
client (Any) – The HTTP client instance used for API calls.
- Return type:
None
- get(cell_instance_id)[source]#
Get a specific cell instance by ID.
- Parameters:
cell_instance_id (str)
- Return type:
- list(cell_spec_id, limit=None, offset=None, *, name=None, name_exact=None, created_by_email=None, created_after=None, created_before=None, updated_after=None, updated_before=None, order_by=None, order=None)[source]#
List cell instances for a specification with optional filtering.
Always returns a
PaginatedListwhich behaves like a regularlist. Uselimitandoffsetto control the page.- Parameters:
cell_spec_id (str) – The ID of the cell specification.
limit (int | None, optional) – Maximum number of instances to return per page.
offset (int | None, optional) – Number of instances to skip for pagination.
name (str | None, optional) – Case-insensitive substring match on instance name.
name_exact (str | None, optional) – Exact match on instance name. Takes precedence over
name.created_by_email (str | None, optional) – Case-insensitive substring match on the creator’s email.
created_after (str | None, optional) – ISO datetime; return instances created after this time.
created_before (str | None, optional) – ISO datetime; return instances created before this time.
updated_after (str | None, optional) – ISO datetime; return instances updated after this time.
updated_before (str | None, optional) – ISO datetime; return instances updated before this time.
order_by (str | None, optional) – Column to sort by (
"name","created_at","updated_at").order (str | None, optional) – Sort direction:
"asc"or"desc".
- Returns:
All instances belonging to the specification.
- Return type:
- update(cell_instance_id, data)[source]#
Update an existing cell instance.
- Parameters:
- Returns:
The updated cell instance.
- Return type:
- delete(cell_instance_id)[source]#
Delete a cell instance by ID.
- Parameters:
cell_instance_id (str)
- Return type:
None
- detail(cell_instance_id, include_steps=True, include_cycles=True, include_time_series=True)[source]#
Get full details for a cell instance.
Composes flat API endpoints in parallel to build the complete detail view. For each measurement, fetches steps/cycles and time series according to the
include_*flags.- Parameters:
cell_instance_id (str) – The cell instance ID.
include_steps (bool, optional) – Whether to fetch step data for each measurement. Defaults to True.
include_cycles (bool, optional) – Whether to fetch cycle metrics for each measurement. Defaults to True.
include_time_series (bool, optional) – Whether to fetch time series for each measurement. Defaults to True.
- Returns:
Instance metadata, specification foreign key, and a list of measurement details.
- Return type:
- create(cell_spec_id, data)[source]#
Create a new cell instance under a specification.
- Parameters:
- Returns:
The newly created cell instance.
- Return type: