This is a previously mentioned issue that I?ve been working with Alexandre Gramfort on. This issue involves setting events from annotations. We are reading in NeuroScan continuous files (.cnt) and it would appear that when trying to pass `mne.Annotations()` our descriptions are in string/text format, whereas they need to be in integer format. To accommodate this, we tried passing the `int()` command to convert, however, we got a TypeError specifying that `only size-1 arrays can be converted to Python scalars`. Sending this to the community email in case anyone else is having the same issues or may have some insight.
Implementing `event_id=int` into `events_from_annotations`, as in your code, was the difference. This is not in the documentation for this function. So I?m glad we were able to cover it here. Thank you for your time and patience in clearing this up!
My apologies for the late response. I looked at changes made for docstring #7183, notes and crossref implementation for annotations.py. I think that these notes are clear and would have prevented the difficulty. However I did notice that when going to the source code link from the MNE page, it did not show the changes for lines 899-900 and 941. Will this take effect after review? Thank you all for addressing these concerns as related to Neuroscan .cnt file annotations.
Very Best,
Bianca Islas
Research Assistant
Psychophysiology of Emotion and Personality Lab
University Nevada, Las Vegas
Hi Bianca,
The reason the [source] link still shows the old code is that you were looking at the documentation for the *stable* version of MNE-Python (note the URL begins with https://mne.tools/stable/). [source] links in the stable documentation don't go to the current master version of the code, they go to a maintenance branch (currently maint/0.19).
If you look at [that page of the documentation for the *development* version of MNE-Python](https://mne.tools/dev/generated/mne.events_from_annotations.html), you'll see in the GitHub URL that the [source] link goes to the current master branch instead of maint/0.19, and the recent changes to the docstring are indeed shown there.
-- dan
Daniel McCloy https://dan.mccloy.info
Research Scientist
Institute for Learning and Brain Sciences
University of Washington