Cell Specification#
Client for managing cell specifications.
For usage examples and guides, see Data API on docs.ionworks.com.
Cell specification client for managing cell type definitions.
This module provides the CellSpecificationClient for creating,
reading, updating, and deleting cell specifications, which define the
properties of battery cell types (manufacturer, chemistry, ratings, etc.).
- class ionworks.cell_specification.CellSpecificationClient(client)[source]#
Bases:
objectClient for managing cell specifications.
Provides methods to create, read, update, and delete cell specifications, which define the properties of battery cell types (manufacturer, chemistry, ratings, etc.).
- Parameters:
client (Any)
- __init__(client)[source]#
Initialize the CellSpecificationClient.
- Parameters:
client (Any) – The HTTP client instance for making API requests.
- Return type:
None
- get(cell_spec_id)[source]#
Get a specific cell specification by ID.
- Parameters:
cell_spec_id (str) – The ID of the cell specification to retrieve.
- Returns:
The requested cell specification object.
- Return type:
- list(include_components=False, limit=None, offset=None, *, name=None, name_exact=None, form_factor=None, created_by_email=None, created_after=None, created_before=None, updated_after=None, updated_before=None, order_by=None, order=None, project_id=None, material_id=None, anode_material_id=None, cathode_material_id=None, electrolyte_material_id=None, separator_material_id=None, case_material_id=None, exclude_cell_spec_id=None)[source]#
List cell specifications with optional pagination and filtering.
Always returns a
PaginatedListwhich behaves like a regularlist. Uselimitandoffsetto control the page.- Parameters:
include_components (bool, optional) – If True, returns each specification with its nested component and material data. Defaults to False (metadata only).
limit (int | None, optional) – Maximum number of specs to return per page.
offset (int | None, optional) – Number of specs to skip for pagination.
name (str | None, optional) – Case-insensitive substring match on spec name.
name_exact (str | None, optional) – Exact match on spec name. Takes precedence over
name.form_factor (str | None, optional) – Exact match on form factor.
created_by_email (str | None, optional) – Case-insensitive substring match on the creator’s email.
created_after (str | None, optional) – ISO datetime; return specs created after this time.
created_before (str | None, optional) – ISO datetime; return specs created before this time.
updated_after (str | None, optional) – ISO datetime; return specs updated after this time.
updated_before (str | None, optional) – ISO datetime; return specs 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".project_id (str | None, optional) – Restrict results to this project. Required for an identity lookup —
name_exactor a material reverse-lookup (seematerial_id) — where it falls back toIONWORKS_PROJECT_IDand raises if neither is set, because those resolve one specific spec and names and materials are only unique within a project. For a plain list, omitting it applies no project filter.material_id (str | list[str] | None, optional) – Return specs referencing this material through any component. A single id matches specs using that material; a list matches specs using any of the given materials.
anode_material_id (str | None, optional) – Return specs whose anode uses this material.
cathode_material_id (str | None, optional) – Return specs whose cathode uses this material.
electrolyte_material_id (str | None, optional) – Return specs whose electrolyte uses this material.
separator_material_id (str | None, optional) – Return specs whose separator uses this material.
case_material_id (str | None, optional) – Return specs whose case uses this material.
exclude_cell_spec_id (str | None, optional) – Exclude the spec with this id from the results.
- Returns:
A list of cell specification objects.
- Return type:
Other cell specs sharing a component material with this spec.
- Parameters:
cell_spec_id (str) – The spec whose slot materials define the search.
slots (list[str] | None, optional) – Slots to compare (subset of anode/cathode/electrolyte/separator/case). None → any slot: match other specs using any of this spec’s slot materials in any slot. A list → per-slot: match each named slot only against this spec’s material in that same slot (e.g.
["anode", "cathode"]finds specs whose anode matches this anode or whose cathode matches this cathode).exclude_self (bool, optional) – Exclude
cell_spec_idfrom results (applied server-side). Defaults True.limit (int, optional) – Maximum number of specs to return per page. Defaults to 100.
offset (int, optional) – Number of specs to skip for pagination. Defaults to 0.
include_components (bool, optional) – If True, return each spec with its nested component and material data. Defaults to False (metadata only).
- Returns:
Specs sharing a material, backend-paginated and self-excluded. Scoped to this spec’s project; for a System-library spec (no project) the search spans the whole org.
- Return type:
- Raises:
ValueError – If
slotscontains an unknown slot name.
- create(data)[source]#
Create a new cell specification.
- create_or_get(data)[source]#
Create a new cell specification or get an existing one.
Creates a new cell specification if it doesn’t exist, otherwise returns the existing one.