battetl.transform package¶
Submodules¶
battetl.transform.Transformer module¶
- class battetl.transform.Transformer.Transformer(timezone: str | None = None, user_transform_test_data: Callable[[DataFrame], DataFrame] | None = None, user_transform_cycle_stats: Callable[[DataFrame], DataFrame] | None = None)¶
Bases:
object- calc_cycle_stats(steps: dict, cv_voltage_threshold_mv: float | None = None, cell_thermocouple: int | None = None) DataFrame¶
Calculates various charge and discharge statistics at the cycle level. Note this function can only be run after self.test_data exists
- Parameters:
steps (dict) – A dictionary containing lists of charge (key->’chg’), discharge (key->’dsg’), and rest (key->’rst’) steps.
cv_voltage_thresh_mv (float) – The the voltage threshold in milli-volts above which charge is considered to be constant voltage.
cell_thermocouple (int) – The number (as listed in the db column) of the thermocouple that’s attached to the cell.
- Returns:
self.cycle_stats – The calculated cycle statistics for all cycles.
- Return type:
pd.DataFrame
- transform_cycle_stats(data: DataFrame) DataFrame¶
Transforms cycle stats to conform to BattETL naming and data conventions
- Parameters:
data (pandas.DataFrame) – The input DataFrame
- Returns:
df – The transformed output DataFrame
- Return type:
pandas.DataFrame
- transform_test_data(data: DataFrame, file_meta: dict | None = None) DataFrame¶
Transforms test data to conform to BattETL naming and data conventions
- Parameters:
data (pandas.DataFrame) – The input DataFrame
schedule_steps (dict) – A dictionary containing lists of charge (key->’chg’), discharge (key->’dsg’), and rest (key->’rst’) steps from the schedule used to generate the data. Used to calculate cycle level statistics (e.g. CV charge time.)s
file_meta (dict, optional) – Dictionary containing the user defined column names for the test data. The default is None.
- Returns:
df – The transformed output DataFrame
- Return type:
pandas.DataFrame
BattETL