pybop._dataset#
Classes#
Represents a collection of experimental observations. |
|
Protocol defining required PyProBE Result interface |
Functions#
|
Import a pyprobe.Result into a dictionary |
Module Contents#
- class pybop._dataset.Dataset(data_dictionary, domain: str | None = None, variables: str | None = ['Time [s]', 'Current [A]', 'Voltage [V]'])[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(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.
- class pybop._dataset.PyprobeResult[source]#
Bases:
ProtocolProtocol defining required PyProBE Result interface
- pybop._dataset.import_pyprobe_result(result: PyprobeResult, pybop_columns: list[str] | None = None, pyprobe_columns: list[str] | None = None) Dataset[source]#
Import a pyprobe.Result into a dictionary
- Parameters:
result (str) – A pyprobe.Result object.
pybop_columns (list[str]) – List of pybop column names.
pyprobe_columns (list[str]) – An list of pyprobe column names.
provided (If only one list of column names is)
identical. (they are assumed to be)