pydpeet.read#

pydpeet.read(config, input_path, keep_all_additional_data=False, custom_folder_path=None)[source]#

Read and convert battery test data into the unified PyDPEET format.

This is the main high-level import function of PyDPEET. The function automatically detects whether the provided input path points to a file, a directory, or a list of files/directories and converts the contained battery test data into the unified PyDPEET dataframe format.

Depending on the provided input, the function either returns a single dataframe or a list of dataframes.

The conversion itself is performed using the selected device configuration.

Parameters:
  • config (ConfigLike) –

    Device configuration used for parsing and mapping the raw battery test data into the unified PyDPEET format.

    This can either be:

    • a predefined PyDPEET configuration

    • a custom configuration object

    • a configuration dictionary

  • input_path (str | list[str]) –

    Path to the input data.

    Supported inputs are:

    • path to a single raw data file

    • path to a directory containing raw data files

    • list of file and/or directory paths

  • keep_all_additional_data (bool, default=False) –

    If True, all additional columns that are not part of the unified PyDPEET format are preserved in the returned dataframe.

    If False, only standardized PyDPEET columns are kept.

  • custom_folder_path (str | None, default=None) – Optional custom folder path used by specific device configurations that require additional external metadata or lookup files.

Returns:

Converted dataframe(s) in the unified PyDPEET format.

  • If a single file or directory is provided, a single dataframe is returned.

  • If a list of paths is provided, a list of dataframes is returned.

Return type:

DataFrame | list[DataFrame]

Raises:

ValueError – Raised if: - the provided input path does not exist - an input path has an invalid type - a list contains unsupported entries

Notes

The returned dataframe follows the standardized PyDPEET format contains following columns, when available in the raw data and depending on the selected device configuration:

  • Date_Time

  • Test_Time[s]

  • Voltage[V]

  • Current[A]

  • Step_Count

  • Temperature[°C]

  • EIS_f[Hz]

  • EIS_Z_Real[Ohm]

  • EIS_Z_Imag[Ohm]

depending on the available raw data and the selected device configuration.

Examples

More Usage Examples can be found in following tutorial notebooks:

Tutorial 01: Convert and Import

Read a single file:

>>> import pydpeet as eet
>>> df = eet.read(
...     config="neware_8_0_0_516",
...     input_path="measurement.csv",
... )

Read all files in a directory:

>>> df = eet.read(
...     config="neware_8_0_0_516",
...     input_path="data/",
... )

Read multiple files and directories:

>>> dfs = eet.read(
...     config="neware_8_0_0_516",
...     input_path=[
...         "measurement_01.csv",
...         "measurement_02.csv",
...         "folder_with_measurements/",
...     ],
... )

Keep additional raw columns:

>>> df = eet.read(
...     config="neware_8_0_0_516",
...     input_path="measurement.csv",
...     keep_all_additional_data=True,
... )

See also

convert

Lower-level conversion interface.

write

Export unified PyDPEET dataframes.

merge_into_series

Merge multiple datasets into a continuous series.