mne-tools / mne-tools/mne-python

persyst annotations error

Open
#8,292 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
3.5k
Forks
1.6k
Avg merge
1d 6h
Merged PRs (30d)
100

Description

Describe the bug

The persyst raw file function is able to open the persyst files and annotations with no issues. The issue I am having. For my particular use case we need to get all annotations regardless if they are repeated. When some of the EEG systems generate annoations they use xlevents or xlspikes and sometimes they can be multiple of these in the files. however the parser is only taking unique annotations. So if a human annotator or machine annotator uses same annotations then the parser is not picking up all of the annotations but rather unique names or the first one with that name.

Steps to reproduce

Open any lay/dat files that have annotations with different times and same name/description

Expected results

The expected behavior is that the parser should be able to pick up all annotations even if they have the same name.

Actual results

only picks up the first annotation with that name.

Additional information

If I have time I can try to submit a suggestion on how to fix it.

I think the issue is that you are using the comment texts as keys for your dictionary of annotations. So when your script finds a new comment with the same text is overwriting the previous one. Perhaps one suggestions to append the values to your keys as a list if the keys are already in the dictionary.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Persyst raw-file annotation parser and reproduce the issue using a lay/dat file containing annotations with different times but the same name or description. Verify that the completed change preserves every annotation, including repeated xlevents or xlspikes, rather than retaining only the first or unique name.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.