Repower Reader¶
- class ionworksdata.read.repower.Repower¶
Bases:
BaseReader- default_options: dict[str, Any] = {'cell_metadata': '[required]', 'file_encoding': 'latin1', 'timezone': 'UTC'}¶
- name: str = 'Repower'¶
- 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 Repower file.
Parameters¶
- filenamestr | Path
Path to the Repower file to be read.
- optionsdict[str, str] | None, optional
Options for reading the file. See
ionworksdata.read.Repower.run().
Returns¶
- datetime
The start time of the Repower 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 Repower file. The following column mappings are applied by default:
“Voltage(V)” -> “Voltage [V]”
“Current(A)” -> “Current [A]”
“Cycle ID” -> “Cycle from cycler”
“Step ID” -> “Step from cycler”
“Step State” -> “Status”
“System Time” -> “System time”
Time columns can be called Relative Time(Sec) or Relative Time(Hour). The time unit is automatically detected and the time column is renamed accordingly.
Additional column mappings can be provided via the extra_column_mappings parameter.
Parameters¶
- filenamestr | Path
Path to the Repower file to be read.
- extra_column_mappingsdict[str, str] | None, optional
Dictionary of additional column mappings to use when reading the Repower 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 Repower file.
Options are:
- file_encoding: str, optional
Encoding format for the Repower file. Default is “latin1”.
- cell_metadata: dict, required
Dictionary containing metadata about the cell, including voltage cutoffs.
- timezone: str, optional
Timezone for timestamps. Default is “UTC”.
Returns¶
- polars.DataFrame
Processed data from the Repower file with standardized column names and units.
Notes¶
This function reads a Repower file, processes the data, and returns a DataFrame with standardized column names and units. It handles data cleaning, formatting, and time adjustments based on the specific structure of Repower files.