mne-python icon indicating copy to clipboard operation
mne-python copied to clipboard

Concatenated raws lose combined annotations extras lists.

Open KareemShalabi opened this issue 4 months ago • 2 comments

When concatenating or appending raws, the final raw object contains annotations with correct onsets but without the extras list associated with the annotations.

raw_2.annotations.append([1.0], [1.0], 'stim', extras=[dict(response=1, react_time=0.5)]
raw.append([raw_2])
print(raw.annotations)     # => annotations 1 segment 'stim'

print(raw.annotations.extras)    # => [{}]

It seems the issue lies in annotations.py/_combine_annotations function where it doesn't handle the extras between the two annots objects and construct the new returned object without the extras keyword argument.

KareemShalabi avatar Jul 03 '26 22:07 KareemShalabi

Hello! 👋 Thanks for opening your first issue here! ❤️ We will try to get back to you soon. 🚴

welcome[bot] avatar Jul 03 '26 22:07 welcome[bot]

Hi! Thanks for reporting this and pointing to _combine_annotations. If no one is currently working on this, I would love to take it up! I can look into merging the extras lists properly in _combine_annotations and add a test case to prevent regression. Could you please assign this to me?

sametSeckiiin avatar Jul 06 '26 12:07 sametSeckiiin