The function extract_features extracts features from a data array X, shape (n_epochs, n_channels, n_times)epoch by epoch. If an epoch is flat (that is, if np.allclose(X[j, :, :], 0) is True), then most feature functions will either return arrays of 0 or fails (log of negative values, division by 0,...).
Possible fix:
The utility function _apply_extractor should check if the epoch is flat and, if so, deal with it (for example: return 0 for all the features + warning to the user).
The function
extract_features
extracts features from a data arrayX, shape (n_epochs, n_channels, n_times)
epoch by epoch. If an epoch is flat (that is, if np.allclose(X[j, :, :], 0) is True), then most feature functions will either return arrays of 0 or fails (log of negative values, division by 0,...).Possible fix: The utility function
_apply_extractor
should check if the epoch is flat and, if so, deal with it (for example: return 0 for all the features + warning to the user).