Closed charlesbmi closed 1 year ago
In the situation that data is not ready before the timeout, .get_data_as_epoch now returns None because EpochsArray(data,...) errors out when data is an empty array.
Should we change MNE-Python to allow EpochsArray
to be an empty array of shape (0, n_channels, n_times)
? We do allow instances of empty Epochs
so I don't see why we couldn't do it for EpochsArray
...
Should we change MNE-Python to allow EpochsArray to be an empty array of shape (0, n_channels, n_times)? We do allow instances of empty Epochs so I don't see why we couldn't do it for EpochsArray...
Seems reasonable to me! The specific error raised here is because the array is empty with shape (1, n_channels, n_times=0)
, but EpochsArray
initialization also errors out if the passed in data is shape (0, n_channels, n_times)
as you mention.
Separately, looks like the jobs are failing due to https://community.codecov.com/t/codecov-yanked-from-pypi-all-versions/4259/9
The update I pushed should fix the codecov problem
Feel free to make a PR to allow 0 length EpochsArray. Maybe not for no time points, but it seems reasonable for zero epochs
Marking for merge when green @charlesincharge , thanks in advance!
As someone creating a real-time application, I sometimes want to limit the amount of time the application is waiting on data. This change makes
wait_time
(now calledtimeout
) a configurable parameter.In the situation that data is not ready before the timeout,
.get_data_as_epoch
now returnsNone
becauseEpochsArray(data,...)
errors out whendata
is an empty array. Note: it was possible fordata
to be empty even before the change, although a shortertimeout
now makes this more likely.