Models

Schemas for battery models supported by the pipeline. Mirrors ionworkspipeline.models.

Schemas for models.

class ionworks_schema.models.ECM(options=None)

Bases: BaseSchema

A class for the Equivalent Circuit Model.

Extends: ionworks_schema.base.BaseSchema

options: dict[str, Any] | None
model_config = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'populate_by_name': True, 'validate_assignment': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_post_init(context: Any, /) None

This function is meant to behave like a BaseModel method to initialise private attributes.

It takes context as an argument since that’s what pydantic-core passes when calling it.

Args:

self: The BaseModel instance. context: The context.

class ionworks_schema.models.LumpedSPMR(options=None)

Bases: BaseSchema

A class for the Lumped Single Particle Model with Resistance.

Extends: ionworks_schema.base.BaseSchema

options: dict[str, Any] | None
model_config = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'populate_by_name': True, 'validate_assignment': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_post_init(context: Any, /) None

This function is meant to behave like a BaseModel method to initialise private attributes.

It takes context as an argument since that’s what pydantic-core passes when calling it.

Args:

self: The BaseModel instance. context: The context.

class ionworks_schema.models.LumpedSPMeR(options=None)

Bases: BaseSchema

A class for the Lumped Single Particle Model with electrolyte and Resistance.

Extends: ionworks_schema.base.BaseSchema

options: dict[str, Any] | None
model_config = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'populate_by_name': True, 'validate_assignment': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_post_init(context: Any, /) None

This function is meant to behave like a BaseModel method to initialise private attributes.

It takes context as an argument since that’s what pydantic-core passes when calling it.

Args:

self: The BaseModel instance. context: The context.

class ionworks_schema.models.MSMRFullCellModel(negative_electrode_model, positive_electrode_model, options=None)

Bases: BaseSchema

Full-cell MSMR model of the open-circuit potential — pairs a negative and positive half-cell MSMR model into one full-cell OCV.

Use this with MSMRFullCell to fit an MSMR description of a full cell from full-cell OCV data.

Parameters

negative_electrode_modelMSMRHalfCellModel

MSMR model for the negative electrode.

positive_electrode_modelMSMRHalfCellModel

MSMR model for the positive electrode.

optionsdict, optional

Extra options forwarded to the underlying model.

Extends: ionworks_schema.base.BaseSchema

negative_electrode_model: Annotated[dict[str, Any] | BaseSchema, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])]
positive_electrode_model: Annotated[dict[str, Any] | BaseSchema, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])]
options: dict[str, Any] | None
model_config = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'populate_by_name': True, 'validate_assignment': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_post_init(context: Any, /) None

This function is meant to behave like a BaseModel method to initialise private attributes.

It takes context as an argument since that’s what pydantic-core passes when calling it.

Args:

self: The BaseModel instance. context: The context.

class ionworks_schema.models.MSMRHalfCellModel(electrode, options=None)

Bases: BaseSchema

Half-cell MSMR (Multi-Species Multi-Reaction) model for one electrode’s open-circuit potential.

Parameters

electrodestr

Electrode the model describes — "positive" or "negative".

optionsdict, optional

Model settings:

  • capacity function: capacity function used by the model.

    Default None.

  • species format: how each MSMR species is parameterised —

    "Qj" (capacity) or "Xj" (mole fraction). Default "Qj".

  • direction: "delithiation", "lithiation", or None

    (no direction assumed). Default None.

  • particle phases: number of phases in the electrode —

    "1" for a single-phase electrode (default) or "2" for a composite with primary and secondary phases.

Extends: ionworks_schema.base.BaseSchema

electrode: Literal['positive', 'negative']
options: dict[str, Any] | None
model_config = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'populate_by_name': True, 'validate_assignment': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_post_init(context: Any, /) None

This function is meant to behave like a BaseModel method to initialise private attributes.

It takes context as an argument since that’s what pydantic-core passes when calling it.

Args:

self: The BaseModel instance. context: The context.

class ionworks_schema.models.SingleElectrodeLumpedSPMR(options=None)

Bases: BaseSchema

A class for the single-electrode Lumped SPM with Resistance.

Extends: ionworks_schema.base.BaseSchema

options: dict[str, Any] | None
model_config = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'populate_by_name': True, 'validate_assignment': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_post_init(context: Any, /) None

This function is meant to behave like a BaseModel method to initialise private attributes.

It takes context as an argument since that’s what pydantic-core passes when calling it.

Args:

self: The BaseModel instance. context: The context.