3.8.2. qupulse.utils.performance¶
Functions
|
This function calculates the average over all windows that are defined by begins and ends. |
|
|
|
|
|
Shrink windows in place if they overlap. |
|
Exceptions
- exception WindowOverlapWarning[source]¶
Bases:
RuntimeWarning- COMMENT = ' This warning is an error by default. Call \'warnings.simplefilter(WindowOverlapWarning, "always")\' to demote it to a regular warning.'¶
- average_windows(time: ndarray, values: ndarray, begins: ndarray, ends: ndarray)[source]¶
This function calculates the average over all windows that are defined by begins and ends. The function assumes that the given time array is monotonically increasing and might produce nonsensical results if not.
- Parameters:
time – Time associated with the values of shape (n_samples,)
values – Values to average of shape (n_samples,) or (n_samples, n_channels)
begins – Beginning time stamps of the windows of shape (n_windows,)
ends – Ending time stamps of the windows of shape (n_windows,)
- Returns:
Averaged values for each window of shape (n_windows,) or (n_windows, n_channels). Windows without samples are NaN.
- njit(x)¶
- shrink_overlapping_windows(begins, lengths, use_numba: bool = False) Tuple[array, array][source]¶
Shrink windows in place if they overlap. Emits WindowOverlapWarning if a window was shrunk.
- Raises:
ValueError – if the overlap is bigger than a window.
Warning
WindowOverlapWarning