pybop._dataset#

Classes#

Dataset

Represents a collection of experimental observations.

Module Contents#

class pybop._dataset.Dataset(data_dictionary)[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.

Interpolant()[source]#

Create an interpolation function of the dataset based on the independent variable.

Currently, only time-based interpolation is supported. This method modifies the instance’s Interpolant attribute to be an interpolation function that can be evaluated at different points in time.

Raises:

NotImplementedError – If the independent variable for interpolation is not supported.

__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 corresonding 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

check(signal=['Voltage [V]'])[source]#

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

Returns:

If True, the dataset has the expected attributes.

Return type:

bool

Raises:

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