conmo.datasets.BatteriesDataset

class conmo.datasets.BatteriesDataset(path: str, chemistry: str, test_set: int)[source]

This is a dataset obtained from measurements of certain types of degradation of three types of batteries. Since it belongs to the local datasets, to launch any experiment with it, it must be stored on disk with the following directory structure: - DTW-Li-ion-Diagnosis

  • dataData and labels for the three types of batteries

    are stored here.

  • mat:
    • LFP:
      • diagnosis:
        • V.mat

      • test:
        • V_references.mat

        • x_test_0.mat

        • x_test_1.mat

        • x_test_2.mat

        • x_test_3.mat

        • y_test.mat

    • NCA:
      • diagnosis

      • test

    • NMC:
      • The same as NCA and LFP

    • Q.mat

IC(u: ~numpy.ndarray, q: ~numpy.ndarray, ui_step: float = 0.0005, minV: float = 3.2, maxV: float = 3.5) -> (<class 'numpy.ndarray'>, <class 'numpy.ndarray'>)[source]

Get the ICA data for a given voltage curve

Parameters
  • u (numpy array) – Voltage curve.

  • q (numpy array) – Capacity curve.

  • ui_step (float) – Step of interpolation.

  • minV (float) – Minimum voltage of the IC curve.

  • maxV (float) – Maximum voltage of the IC curve.

Returns

ui, dqi – Interpolated voltage and derivative of capacity

Return type

numpy arrays

__init__(path: str, chemistry: str, test_set: int) None[source]

Constructor of local dataset.

Parameters

path (str) – Absolute path to the folder where the dataset is located in your disk. See the example of batteries_degradation.py.

convert_to_input_data(ui_new: list, Q: list, size: int, material: int) ndarray[source]

Converts the voltage values of the real cells to the input data for the neural network

Parameters
  • ui_new (array) – Voltage values of the cell at each cycle in percentage.

  • Q (array) – Capacity percentages from 0 to 100 from the simulated dataset.

  • size (int) – The length of the curves.

  • material (str) – Chemistry of the cell.

Returns

x_test – The input data for the neural network.

Return type

array

dataset_files() Iterable[source]

Iterable of files included in the dataset.

feed_pipeline(out_dir: str) None[source]

Copy selected data file to pipeline step folder.

Parameters

out_dir – Directory where the dataset was originally stored.

fetch(out_dir: str) None

Fetch data to feed the pipeline.

Parameters

out_dir (str) – Directory where the dataset will be stored.

get_minmaxV(material: ~numpy.ndarray) -> (<class 'int'>, <class 'int'>, <class 'str'>)[source]

Returns the range voltage in which to study the IC curves

Parameters

material (numpy array) – Chemistry to study.

Returns

min_v, max_v, path – Min and max voltage values and path where data is located,

Return type

numpy arrays, str

is_dataset_ready() bool

Check if dataset has been already loaded/downloaded and parsed to package format.

load() None[source]

Parse dataset train/test data to match Conmo’s standard.

normalise_data(data: ndarray, min_val: float, max_val: float, low: int = 0, high: int = 1) float[source]

Normalises the data to the range [low, high]

Parameters
  • data (numpy array) – Data to normalise.

  • min (float) – Minimum value of data.

  • max (float) – Maximum value of data.

  • low (float) – Minimum value of the range.

  • high (float) – Maximum value of the range.

Returns

normalised_data – normalised data

Return type

float

reduce_size(ui: ndarray, dqi: ndarray, size: int) ndarray[source]

Reduces the length of the IC data to a given size

Parameters
  • ui (numpy array) – Voltage curve.

  • dqi (numpy array) – Derivative of capacity (IC).

  • size (int) – Size at which to reduce the IC data.

Returns

Reduced IC.

Return type

numpy array

show_start_message() None

Show starting step info message.

sklearn_predefined_split() Iterable[int][source]

Generates array of indexes of same length as sequences to be used with ‘PredefinedSplit’

Return type

array, list with the index for each sequence of the dataset.

Methods

IC(u, q[, ui_step, minV, maxV])

Get the ICA data for a given voltage curve

__init__(path, chemistry, test_set)

Constructor of local dataset.

convert_to_input_data(ui_new, Q, size, material)

Converts the voltage values of the real cells to the input data for the neural network

dataset_files()

Iterable of files included in the dataset.

feed_pipeline(out_dir)

Copy selected data file to pipeline step folder.

fetch(out_dir)

Fetch data to feed the pipeline.

get_minmaxV(material)

Returns the range voltage in which to study the IC curves

is_dataset_ready()

Check if dataset has been already loaded/downloaded and parsed to package format.

load()

Parse dataset train/test data to match Conmo's standard.

normalise_data(data, min_val, max_val[, ...])

Normalises the data to the range [low, high]

reduce_size(ui, dqi, size)

Reduces the length of the IC data to a given size

show_start_message()

Show starting step info message.

sklearn_predefined_split()

Generates array of indexes of same length as sequences to be used with 'PredefinedSplit'

Attributes

CHEMISTRY_LIST

MAX_V

MAX_V_LFP

MAX_V_NCA

MAX_V_NMC

MIN_V

MIN_V_LFP

MIN_V_NCA

MIN_V_NMC

SIZE

UI_STEP