CSV Reader

class ionworksdata.read.csv.CSV

Bases: BaseReader

default_options: dict[str, Any] = {'cell_metadata': {}}
name: str = 'CSV'
read_start_time(filename: str | Path, extra_column_mappings: dict[str, str] | None = None, options: dict[str, str] | None = None) None
run(filename: str | Path, extra_column_mappings: dict[str, str] | None = None, options: dict[str, str] | None = None) DataFrame

Read a CSV file and return a Polars DataFrame with appropriate column names.

Parameters

filenamestr | Path

Path to the CSV file to be read.

extra_column_mappingsdict[str, str] | None, optional

Dictionary of additional column mappings to use when reading the CSV file. The keys are the original column names and the values are the new column names. Default is None.

optionsdict[str, str] | None, optional

Dictionary of options to use when reading the CSV file.

Options are:

  • cell_metadata: dict, optional

    Additional metadata about the cell. Default is empty dict.

Returns

pl.DataFrame

Processed data from the CSV file with standardized column names and units. By default, only returns the columns “Time [s]”, “Voltage [V]”, “Current [A]”, “Current [mA.cm-2]”, and “Temperature [degC]”.