Adding a Cycler#

Once parsed into the standard format, PyProBE is agnostic to the source of the data. However, there is a processing step that is required for data from all cycler to be converted into this format. This is done from within the pyprobe.cyclers module.

Most of the work is done by the BaseCycler class. The cycler-specific modules exist to modify settings, and sometimes override functions of this class. This guide will go through the steps of making a cycler module to allow PyProBE to work with your data.

  1. Set up the class.

    The class should inherit from BaseCycler which is a Pydantic BaseModel. You should then declare the following variables:

    • input_data_path as an unset string

    • column_dict a dictionary relating the cycler format for column headings to the PyProBE format. E.g. {"I/*": Current [*]}. Note that the units are indicated by an asterisk *: PyProBE will perform unit conversion automatically.

    Below is an example from the Biologic class:

     1
     2class Biologic(BaseCycler):
     3    """A class to load and process Biologic battery cycler data."""
     4
     5    input_data_path: str
     6    column_dict: dict[str, str] = {
     7        "Date": "Date",
     8        "time/*": "Time [*]",
     9        "Ns": "Step",
    10        "I/*": "Current [*]",
    11        "<I>/*": "Current [*]",
    12        "Ecell/*": "Voltage [*]",
    13        "Q charge/*": "Charge Capacity [*]",
    14        "Q discharge/*": "Discharge Capacity [*]",
    
  2. Add a method to read a file into a dataframe.

    The read_file() method works for the simplest example, where the file contents are only the data under column headings. This may work for you, or may just require adding to its list of recognized file extensions.

    However, some cyclers, like the Biologic, have large headers which may have data you need to extract. The Biologic class’ read_file() method extracts the start time from the header and uses it to form a date column. If you need to do the same, simply define your own copy of the read_file method in the class of your cycler.

  3. Add a method to form the complete imported dataframe.

    It is very likely that the base get_imported_dataframe() will work for you, in which case you will not need this function. In the BiologicMB class, this method is used when there are multiple ModuloBat files being read to concatenate the dataframes while ensuring that the step number does not reduce to zero when the start of one file ends and another begins.

  4. Add column property overrides as needed.

    The BaseCycler includes properties for reading each column of the data. If any of these need adjusting, re-define them in your new cycler class. For example, the Biologic class overrides the step property, to add one to the step number to change from 0-indexing to 1-indexing.