mne-tools / mne-tools/mne-python
Bug: event_repeated metadata incompatibility
Open
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 3.5k
- Forks
- 1.6k
- Avg merge
- 1d 6h
- Merged PRs (30d)
- 100
Description
mne.Epochs event_repeated parameter does not play well metadata:
import mne
import numpy as np
import pandas as pd
raw_data = np.random.randn(2, 10000)
info = mne.create_info(2, 1000.)
raw = mne.io.RawArray(raw_data, info)
opts = dict(raw=raw, tmin=0, tmax=.001, baseline=None)
No problem when there are no repeated events and metadata
events = [[0, 0, 1], [1, 0, 1]]
metadata = pd.DataFrame(events, columns=['onset', 'duration', 'value'])
epochs = mne.Epochs(events=events, metadata=metadata, **opts)
No problem when repeated events and no metadata
events = [[1, 0, 1], [1, 0, 1]]
epochs = mne.Epochs(events=events, event_repeated='drop', **opts)
problem when repeated events and metadata
events = [[1, 0, 1], [1, 0, 1]]
epochs = mne.Epochs(events=events, event_repeated='drop', metadata=metadata, **opts)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by running the provided reproducer with mne.Epochs, event_repeated='drop', and metadata. Trace how repeated events are removed and how metadata rows are aligned; done means the repeated-event case works with metadata without an incompatibility.
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
- 45/100