Neware Reader¶
- class ionworksdata.read.neware.Neware¶
Bases:
BaseReader- default_options: dict[str, Any] = {'cell_metadata': {}, 'sheets': None}¶
- name: str = 'Neware'¶
- read_start_time(filename: str | Path, extra_column_mappings: dict[str, str] | None = None, options: dict[str, str] | None = None) datetime¶
Read the start time from a Neware file (CSV or Excel).
Parameters¶
- filenamestr | Path
Path to the Neware file to be read (supports .csv, .xls, .xlsx).
- extra_column_mappingsdict[str, str] | None, optional
Dictionary of additional column mappings to use when reading the Neware file.
- optionsdict[str, str] | None, optional
Options for reading the file. See
ionworksdata.read.Neware.run(). Can include ‘sheets’ specification for Excel files.
Returns¶
- datetime
The start time of the Neware file.
- run(filename: str | Path, extra_column_mappings: dict[str, str] | None = None, options: dict[str, str] | None = None) DataFrame¶
Read and process data from a Neware file (CSV or Excel). The following column mappings are applied by default:
“Current (mA)”, “Cur(mA)”, “Current(A)” -> “Current [mA]”
“Current (A)” -> “Current [A]”
“Voltage (V)”, “Voltage(V)” -> “Voltage [V]”
“Temperature 1 (degC)” -> “Temperature [degC]”
“Step ID”, “Step” -> “Step from cycler”
“Cycle ID”, “Cycle” -> “Cycle from cycler”
“Status” -> “Status”
“DateTime”, “Absolute Time”, “Date(h:min:s.ms)” -> “Timestamp”
Additional column mappings can be provided via the extra_column_mappings parameter.
Parameters¶
- filenamestr | Path
Path to the Neware file to be read (supports .csv, .xls, .xlsx).
- extra_column_mappingsdict[str, str] | None, optional
Dictionary of additional column mappings to use when reading the Neware 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 Neware file. Supported options:
‘cell_metadata’: dictionary of metadata about the cell
‘sheets’: dict specifying sheet selection for Excel files (.xls/.xlsx only). If not specified, reads the first sheet (index 0). Format:
{‘type’: ‘name’, ‘value’: ‘Sheet1’} for single sheet
{‘type’: ‘name’, ‘value’: [‘Sheet1’, ‘Sheet2’]} for multiple sheets
{‘type’: ‘pattern’, ‘value’: ‘regex_pattern’} for pattern matching
{‘type’: ‘all’} to read all sheets
Returns¶
- pandas.DataFrame
Processed data from the Neware file with standardized column names and units. If multiple sheets are read, a ‘Sheet’ column is added to identify the source sheet.
Notes¶
This function reads a Neware file (CSV or Excel), processes the data, and returns a DataFrame with standardized column names and units. It also handles data cleaning tasks such as removing NaNs and converting the datetime to seconds from start. For Excel files, you can specify which sheets to read using ‘sheets’ in options.