pybop._dataset#

Classes#

Dataset

Represents a collection of experimental observations.

Module Contents#

class pybop._dataset.Dataset(data_dictionary, domain: str | None = None)[source]#

Represents a collection of experimental observations.

This class provides a structured way to store and work with experimental data, which may include applying operations such as interpolation.

Parameters:
  • data_dictionary (dict or instance of pybamm.solvers.solution.Solution) – The experimental data to store within the dataset.

  • domain (str, optional) – The domain of the dataset. Defaults to “Time [s]”.

__getitem__(key)[source]#

Return the data corresponding to a particular key.

Parameters:

key (str) – The name of a data series within the dataset.

Returns:

The data series corresponding to the key.

Return type:

list or np.ndarray

Raises:

ValueError – The key must exist in the dataset.

__repr__()[source]#

Return a string representation of the Dataset instance.

Returns:

A string that includes the type and contents of the dataset.

Return type:

str

__setitem__(key, value)[source]#

Set the data corresponding to a particular key.

Parameters:
  • key (str) – The name of the key to be set.

  • value (list or np.ndarray) – The data series to be stored in the dataset.

_check_data_consistency(domain_data: numpy.ndarray, signals: list[str]) None[source]#
static _check_frequency_constraints(freq_data: numpy.ndarray) None[source]#
static _check_time_constraints(time_data: numpy.ndarray) None[source]#
check(domain: str = None, signal: str | list[str] = None) bool[source]#

Check the consistency of a PyBOP Dataset against the expected format.

Parameters:
  • domain (str, optional) – If not None, updates the domain of the dataset.

  • signal (str or List[str], optional) – The signal(s) to check. Defaults to [“Voltage [V]”].

Returns:

True if the dataset has the expected attributes.

Return type:

bool

Raises:

ValueError – If the time series and the data series are not consistent.

get_subset(index: list | numpy.ndarray)[source]#

Reduce the dataset to a subset defined by the list of indices.

data[source]#
domain = 'Time [s]'[source]#