pyprobe.rawdata module#

A module for the RawData class.

pydantic model RawData(*, base_dataframe, info, column_definitions=None, step_descriptions={})#

Bases: Result

A class for holding data in the PyProBE format.

This is the default object returned when data is loaded into PyProBE with the standard methods of the pyprobe.cell.Cell class. It is a subclass of the pyprobe.result.Result class so can be used in the same way as other result objects.

The RawData object is stricter than the pyprobe.result.Result object in that it requires the presence of specific columns in the data. These columns are:

  • Time [s]

  • Step

  • Cycle

  • Event

  • Current [A]

  • Voltage [V]

  • Capacity [Ah]

This defines the PyProBE format.

Validators:
Parameters:
  • base_dataframe (LazyFrame | DataFrame)

  • info (Dict[str, str | int | float | Dict[Any, Any] | None])

  • column_definitions (Dict[str, str])

  • step_descriptions (Dict[str, List[str | int | None]])

Return type:

None

field column_definitions: Dict[str, str] [Optional]#

A dictionary containing the definitions of the columns in the data.

Validated by:
  • _load_base_dataframe

field step_descriptions: Dict[str, List[str | int | None]] = {}#

A dictionary containing the fields ‘Step’ and ‘Description’.

  • ‘Step’ is a list of step numbers.

  • ‘Description’ is a list of corresponding descriptions in PyBaMM Experiment format.

Validated by:
  • _load_base_dataframe

validator check_required_columns  »  base_dataframe#

Check if the required columns are present in the input_data.

Parameters:

dataframe (LazyFrame | DataFrame)

Return type:

RawData

zero_column(column, new_column_name, new_column_definition=None)#

Set the first value of a column to zero.

Parameters:
  • column (str) – The column to zero.

  • new_column_name (str) – The new column name.

  • new_column_definition (Optional[str]) – The new column definition.

Returns:

The dataframe or lazyframe with the new column.

Return type:

pl.DataFrame | pl.LazyFrame

property capacity: float#

Calculate the net capacity passed.

Returns:

The net capacity passed.

Return type:

float

set_SOC(reference_capacity=None, reference_charge=None)#

Add an SOC column to the data.

Apply this method on a filtered data object to add an SOC column to the data. This column remains with the data if the object is filtered further.

The SOC column is calculated either relative to a provided reference capacity value, a reference charge (provided as a RawData object), or the maximum capacity delta across the data in the RawData object upon which this method is called.

Parameters:
  • reference_capacity (Optional[float]) – The reference capacity value.

  • reference_charge (Optional[RawData]) – A RawData object containing a charge to use as a reference.

Return type:

None

set_reference_capacity(reference_capacity=None)#

Fix the capacity to a reference value.

Apply this method on a filtered data object to fix the capacity to a reference. This calculates a permanent column named Capacity - Referenced [Ah] in the data, which remains if this object is filtered further.

The reference value is either the maximum capacity delta across the data in the RawData object upon which this method is called or a user-specified value.

Parameters:

reference_capacity (Optional[float]) – The reference capacity value.

Return type:

None

property pybamm_experiment: Experiment#

Return a PyBaMM experiment object for the filtered section of data.

Returns:

The PyBaMM experiment object.

Return type:

pybamm.Experiment