cideMOD.cell.parser

Classes

BaseComponentParser(root[, dic, tag])

Base class for component parser creation.

CellParser(cell_data, data_path, model_options)

Parser of cell dictionary/JSON into a python object.

ElectrodeParser(cell, dic[, tag])

class cideMOD.cell.parser.BaseComponentParser(root, dic={}, tag=None)[source]

Bases: ABC

Base class for component parser creation.

Parameters:
  • root (Optional[BaseComponentParser]) – Component to which it belongs. If it does not the case, then it should be None.

  • dic (dict) – Dictionary containing the parameters of the component.

  • tag (str) – Tag to identify the component between the available tags.

property complete_tag
property dic
get_component(name) Self[source]

This method return the specified component

get_parameter(name) CellParameter[source]

This method return the specified parameter

get_value(name)[source]

This method return the user value of the specified parameter

property label
class property name
set_component(component: str | Self) Self[source]

This method initialize and sets the given component as a component of this component.

set_parameter(name: str, element: str | None = None, default=None, dtypes: Tuple[str] | str | None = 'real', is_optional=False, can_vary: bool = True, can_effective: bool = False, can_arrhenius: bool = False, can_ref_temperature: bool = False, can_hysteresis: bool = False, is_user_input: bool = True, description: str | None = None, aliases: list | tuple | str = []) CellParameter[source]

This method sets the given parameter to this component.

Parameters:
  • name (str) – Name of the cell parameter.

  • element (Optional[str]) – Dictionary entry of the element where the parameter is defined. Assume that the parameter is defined within the component dictionary if the element is not specified.

  • default (Any) – Default value of the parameter if it is optional and the user does not specified it.

  • dtypes (Optional[Union[Tuple[str], str]]) – Available datatypes that are allowed. It must be one of real, expression, spline or label.

  • is_optional (bool) – Whether this parameter is optional or not. Default to True.

  • can_vary (bool) – Whether this parameter can be defined as a dynamic parameter. Default to True.

  • can_effective (bool) – Whether this parameter can be defined as an effective parameter. Default to False.

  • can_arrhenius (bool) – Whether the arrhenius correction can be applied to this parameter. Default to False.

  • can_ref_temperature (bool) – Whether this parameter can have a reference temperature.

  • can_hysteresis (bool) – Whether this parameter can have hysteresis.

  • description (Optional[str]) – Description of the parameter.

  • aliases (Union[list, tuple]) – List or tuple containing the aliases of the parameter if any.

  • is_user_input (bool) – Whether or not this parameter is a user input.

set_parameters(options_dict: dict)[source]
property tag
class cideMOD.cell.parser.CellParser(cell_data: dict | str, data_path: str, model_options)[source]

Bases: BaseComponentParser

Parser of cell dictionary/JSON into a python object. Resolves any links between different files.

Parameters:
  • cell_data (Union[dict,str]) – Dictionary of the cell parameters or path to a JSON file containing them.

  • data_path (str) – Path to the folder where cell_data is together with extra data like materials OCVs.

  • model_options (BaseModelOptions) – Object containing the simulation options.

get_dict(base=None)[source]
read_param_file(path)[source]
update_parameter(name: str, value) None[source]

This method updates the value of the specified parameter of this component or the components it has.

Parameters:
  • name (str) – Name of the parameter to be updated.

  • value (Any) – Value of the parameter to be updated.

Examples

To update a parameter of this component:

>>> cell.update_parameter('area', 0.1)

or

>>> cell.update_parameter('cell.area', 0.1)

To update a parameter of a subcomponent:

>>> cell.update_parameter('anode.thickness', 1e-4)
update_parameters(parameters: dict) None[source]

This method updates the values of the parameters of this component and the components it has.

Parameters:

parameters (dict) – Dictionary containing the parameter names and values to be updated.

Examples

To update a parameter of this component:

>>> cell.update_parameters({'area': 0.1})

or

>>> cell.update_parameters({'cell.area': 0.1})

To update a parameter of a subcomponent:

>>> cell.update_parameters({'anode.thickness': 1e-4})
write_param_file(path)[source]
class cideMOD.cell.parser.ElectrodeParser(cell, dic, tag=None)[source]

Bases: BaseComponentParser

class ActiveMaterialParser(electrode, dic: dict, index: int, tag=None)[source]

Bases: BaseComponentParser

property complete_tag
property electrode_tag