pyprobe.cyclers.basecycler module#
A module to load and process battery cycler data.
- pydantic model BaseCycler(*, input_data_path, column_dict, datetime_format=None, header_row_index=0)#
- Bases: - BaseModel- A class to load and process battery cycler data. - Validators:
- _check_column_dict»- column_dict
- _check_input_data_path»- input_data_path
- import_and_validate_data»- all fields
 
- Parameters:
- input_data_path (str) 
- column_dict (Dict[str, str]) 
- datetime_format (str | None) 
- header_row_index (int) 
 
- Return type:
- None 
 - field input_data_path: str [Required]#
- The path to the input data. - Validated by:
- _check_input_data_path
 
 
 - field column_dict: Dict[str, str] [Required]#
- A dictionary mapping the column name format of the cycler to the PyProBE format. Units are indicated by an asterisk (*). - Validated by:
- _check_column_dict
 
 
 - field datetime_format: str | None = None#
- The string format of the date column if present. See the chrono crate documentation for more information on the format string. - Validated by:
 
 - field header_row_index: int = 0#
- The index of the header row in the data file. - Validated by:
 
 - validator import_and_validate_data » all fields#
- Import the data and validate the column mapping. - Return type:
 
 - static read_file(filepath, header_row_index=0)#
- Read a battery cycler file into a DataFrame. - Parameters:
- filepath (str) – The path to the file. 
- header_row_index (int) – The index of the header row. 
- header_row_index – The index of the header row. 
 
- Returns:
- The DataFrame. 
- Return type:
- pl.DataFrame | pl.LazyFrame 
 
 - get_imported_dataframe(dataframe_list)#
- Return a single DataFrame from a list of DataFrames. - Parameters:
- dataframe_list (List[DataFrame]) – A list of DataFrames. 
- Returns:
- A single DataFrame. 
- Return type:
- DataFrame 
 
 - property pyprobe_dataframe: DataFrame#
- The DataFrame containing the required columns. - Returns:
- The DataFrame. 
- Return type:
- pl.DataFrame 
 
 - property date: Expr#
- Identify and format the date column. - Returns:
- A polars expression for the date column. 
- Return type:
- pl.Expr 
 
 - property time: Expr#
- Identify and format the time column. - Returns:
- A polars expression for the time column. 
- Return type:
- pl.Expr 
 
 - property current: Expr#
- Identify and format the current column. - Returns:
- A polars expression for the current column. 
- Return type:
- pl.Expr 
 
 - property voltage: Expr#
- Identify and format the voltage column. - Returns:
- A polars expression for the voltage column. 
- Return type:
- pl.Expr 
 
 - property charge_capacity: Expr#
- Identify and format the charge capacity column. - Returns:
- A polars expression for the charge capacity column. 
- Return type:
- pl.Expr 
 
 - property discharge_capacity: Expr#
- Identify and format the discharge capacity column. - Returns:
- A polars expression for the discharge capacity column. 
- Return type:
- pl.Expr 
 
 - property capacity_from_ch_dch: Expr#
- Calculate the capacity from charge and discharge capacities. - Returns:
- A polars expression for the capacity column. 
- Return type:
- pl.Expr 
 
 - property capacity: Expr#
- Identify and format the capacity column. - Returns:
- A polars expression for the capacity column. 
- Return type:
- pl.Expr 
 
 - property temperature: Expr#
- Identify and format the temperature column. - Returns:
- A polars expression for the temperature column. 
- Return type:
- pl.Expr 
 
 - property step: Expr#
- Identify the step number. - Returns:
- A polars expression for the step number. 
- Return type:
- pl.Expr 
 
 - property event: Expr#
- Identify the event number. - Events are defined by any change in the step number, increase or decrease. - Returns:
- A polars expression for the event number. 
- Return type:
- pl.Expr