Cell Specification Values¶
- ionworkspipeline.direct_entries.cell_spec.read_cell_spec_value(spec: dict, name: str, path: str, input_name: str | None = None) tuple[float | CellSpecTable, dict]¶
Read one parameter’s value from a cell specification, converting its unit.
Parameters¶
- specdict
The cell specification with its components, as the Ionworks Studio API returns it. A table is a dict with
xandylists and theirx_unitandy_unit.- namestr
The parameter name. The value is converted to the unit in its bracket.
- pathstr
The dotted JSON path of the value in the specification, e.g.
anode.properties.thickness.- input_namestr, optional
For a table: the name of the input the parameter is a function of. The table’s axis is converted to the unit in its bracket. Without it the axis is converted to SI base units, the units PyBaMM’s function inputs take.
Returns¶
- valuefloat or CellSpecTable
The value in the unit of
name.- provenancedict
The path and value it was read from, e.g.
{"path": "anode.properties.thickness", "value": 72.225, "unit": "um"}, or{"path": ..., "points": 236}for a table.
Raises¶
- CellSpecReadError
If the path names nothing in the specification, the value is not a quantity or a table, or its unit doesn’t convert to the parameter’s.
- class ionworkspipeline.direct_entries.cell_spec.CellSpecTable(x: list[float], y: list[float])¶
A table read from a cell specification, converted to its parameter’s units.
yis in the unit of the parameter’s name andxin the unit of the input it is a function of, e.g. an OCP inVagainst a stoichiometry.
- class ionworkspipeline.direct_entries.cell_spec.CellSpecReadError(message: str, code: Literal['missing', 'unit_mismatch', 'wrong_shape'])¶
A mapped cell specification value that can’t be read.
codesays why:"missing"(the path names nothing),"unit_mismatch"(the value doesn’t convert to the parameter’s unit) or"wrong_shape"(the path names something that is not a quantity or a table).Extends:
UserConfigurationError