cellpy.readers.instruments.processors package#

Submodules#

cellpy.readers.instruments.processors.post_processors module#

Post-processing methods for instrument loaders.

All methods must implement the following parameters/arguments:

- data: Data
- config_params: ModelParameters

All methods should return the modified Data object.

You can access the individual parameters for the post processor from the config_params.post_processor[<name of post processor>].

convert_date_time_to_datetime(data: Data, config_params: ModelParameters) Data[source]#

Convert date_time column to datetime.

convert_step_time_to_timedelta(data: Data, config_params: ModelParameters) Data[source]#

Convert step_time to timedelta.

convert_test_time_to_timedelta(data: Data, config_params: ModelParameters) Data[source]#

Convert test_time to timedelta.

cumulate_capacity_within_cycle(data: Data, config_params: ModelParameters) Data[source]#

Cumulates the capacity within each cycle

date_time_from_test_time(data: Data, config_params: ModelParameters) Data[source]#

Add a date_time column (based on the test_time column).

remove_last_if_bad(data: Data, config_params: ModelParameters) Data[source]#

Drop the last row if it contains more NaNs than second to last.

rename_headers(data: Data, config_params: ModelParameters) Data[source]#

Rename headers to the correct Cellpy headers.

select_columns_to_keep(data: Data, config_params: ModelParameters) Data[source]#

Select columns to keep in the raw data.

set_cycle_number_not_zero(data: Data, config_params: ModelParameters) Data[source]#

Set cycle number to start from 1 instead of 0.

set_index(data: Data, config_params: ModelParameters) Data[source]#

Set index to data_point.

split_capacity(data: Data, config_params: ModelParameters) Data[source]#

Split capacity into charge and discharge

split_current(data: Data, config_params: ModelParameters) Data[source]#

Split current into positive and negative

update_headers_with_units(data: Data, config_params: ModelParameters) Data[source]#

Update headers with units.

cellpy.readers.instruments.processors.pre_processors module#

Pre-processing methods for instrument loaders.

All methods must implement the following parameters/arguments:

- filename: Union[str, pathlib.Path]
- *args and **kwargs: Any additional parameters/arguments should be supported.

All methods should return None (i.e. nothing).

remove_empty_lines(filename: str | Path, *args, **kwargs) Path[source]#

Remove all the empty lines in the file.

The method saves to the same name as the original file, so it is recommended to work on a temporary copy of the file instead of the original file.

Parameters:
  • filename – path to the file.

  • *args – None supported.

  • **kwargs – None supported.

Returns:

pathlib.Path of modified file

Module contents#