Importing Data ============== Making a cell object -------------------- PyProBE stores all experimental data and information in a :class:`pyprobe.cell.Cell` object. It has two main attributes: - a dictionary of cell details and experimental info (:attr:`pyprobe.cell.Cell.info`) - a dictionary of experimental procedures performed on the cell (:attr:`pyprobe.cell.Cell.procedure`). A cell object can be created by providing an info dictionary as a keyword argument to ``info``: .. code-block:: python import pyprobe # Describe the cell. Required fields are 'Name'. info_dictionary = {'Name': 'Sample cell', 'Chemistry': 'NMC622', 'Nominal Capacity [Ah]': 0.04, 'Cycler number': 1, 'Channel number': 1,} # Create a cell object cell = pyprobe.Cell(info = info_dictionary) The ``info`` dictionary can contain any number of key-value pairs that provide metadata to identify the cell and the conditions it was tested under. .. _adding_data_to_cell: Importing data from a cycler ---------------------------- PyProBE defines a Procedure as a dataset collected from a single run of an experimental protocol created on a battery cycler. Throughout its life, a cell will likely undergo multiple procedures, such as beginning-of-life testing, degradation cycles, reference performance tests (RPTs) etc. Data can be imported into PyProBE from a range of cyclers. You import data from a cycler using the :func:`~pyprobe.cell.Cell.import_from_cycler` method: .. code-block:: python # From the previously created cell instance cell.import_from_cycler( procedure_name="Sample", cycler="neware", input_data_path="path/to/cycler_file.csv") This will do two things: 1. Convert the data in the cycler file into the PyProBE standard format, saved to a '.parquet' file. By default, the file will be saved to the same path with only the file extension changed, however this can be controlled by passing a filepath to the :code:`output_data_path` argument of this function. 2. Import the data into a the cell's :code:`procedure` dictionary with the given name as the dictionary key. These steps can be separated. You can perform step 1 with the :func:`pyprobe.cell.process_cycler_data` method, and step 2 with the :func:`pyprobe.cell.Cell.import_data` method. The first time this method is called will take longer than subsequent calls as the data conversion is executed. Once the '.parquet' file is written future executions will be much faster. Any number of procedures can be added to a cell, for example: .. code-block:: python # Add the first procedure cell.import_from_cycler( procedure_name="Cycling", cycler="neware", input_data_path="path/to/cycler_file_cycling.csv") # Add the second procedure cell.import_from_cycler( procedure_name="RPT", cycler="neware", input_data_path="path/to/cycler_file_RPT.csv") print(cell.procedure) # Returns: dict({'Cycling':