Repower Reader

class ionworks.data.read.repower.Repower[source]

Bases: BaseReader

name: str = 'Repower'
default_options: dict[str, Any] = {'cell_metadata': '[required]', 'file_encoding': 'latin1', 'timezone': 'UTC'}
run(filename: str | Path, extra_column_mappings: dict[str, str] | None = None, options: dict[str, str] | None = None) → DataFrame[source]

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:
  • filename (str | Path) – Path to the Repower file to be read.

  • extra_column_mappings (dict[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.

  • options (dict[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:

Processed data from the Repower file with standardized column names and units.

Return type:

polars.DataFrame

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.

read_start_time(filename: str | Path, extra_column_mappings: dict[str, str] | None = None, options: dict[str, str] | None = None) → datetime[source]

Read the start time from a Repower file.

Parameters:
  • filename (str | Path) – Path to the Repower file to be read.

  • options (dict[str, str] | None, optional) – Options for reading the file. See ionworks.data.read.Repower.run().

Returns:

The start time of the Repower file.

Return type:

datetime

read_metadata(filename: str | Path, options: dict[str, str] | None = None) → dict[str, Any][source]

Report the reader’s name and start time: the format carries no more.

Overrides the base reader only to record why nothing is added. The format has no header block, schedule name, channel or instrument field.

Parameters:
  • filename (str | Path) – Path to the Repower CSV file.

  • options (dict[str, str] | None, optional) – Options for reading the file. See ionworks.data.read.Repower.run().

Returns:

test_setup["cycler"] plus start_time, from the System Time column’s earliest value.

Warm Temp setting and humidity setting are not recorded: both read 0 on a rig with no chamber, indistinguishable from a real 0 °C setpoint.

Return type:

dict[str, Any]

Notes

cell_metadata is defaulted when omitted. Only this reader marks it [required], for the cut-offs run() labels steps with; reading one column needs nothing about the cell.