Fix read_raw_eyelink() failure when recording blocks are empty or starting with empty values
#13571
+57
−14
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Reference issue (if any)
Fixes #13555 and #13567.
What does this implement/fix?
Bug 1 (#13555):
When a recording block is completely empty, it seems that channel names cannot be parsed properly, leading to subsequent error in setting channel-specific annotations.
Solutions in progress (need to first understand how empty block data is handled).
Bug 2 (#13567)
When a recording block starts with missing data, the status column is not present until actual data is present:
While it does not prevent the block to be read into a DataFrame (with four columns, in this case), the status column would start with
Noneinstead of any subscriptable string, causing aTypeError.The fix instead gets the first valid value to infer if the column is status or not. Further, it updates the method to infer if the first value is numeric by trying to convert it to float.
Question: If
not len(first_value) in [3, 5, 13, 17], should the code emit a warning/error to contact MNE developers?Minor fixes
if "PUPIL" in units, warn "Raw pupil position data detected" instead of "Raw eyegaze coordinates detected".Additional information
Apparently, testing data that reflects such edge cases is needed. @scott-huberty suggested modiying
_simulate_eye_tracking_data(which is already simulating multi-block data)