Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MRG] FIX: Support commas in BrainVision channel names, event types, and event descriptions #8492

Merged
merged 10 commits into from Nov 9, 2020

Conversation

sappelhoff
Copy link
Member

This came up in bids-standard/pybv#53

In the BrainVision format channel names, event types, and event descriptions that contain a comma , are encoded such that the comma is written as \1.

I add a test here to show that MNE-Python does currently not adequately replace the \1 characters to , during reading.

This is potentially broken for event type and event description as well, but I haven't looked into that yet.

Should we fix it?

Copy link
Member

@larsoner larsoner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we fix it?

Yes I think fixing the channel names and the event type and descriptions would be good

mne/io/brainvision/tests/test_brainvision.py Outdated Show resolved Hide resolved
@sappelhoff sappelhoff force-pushed the commabv branch 3 times, most recently from 491c283 to 0a47b37 Compare November 6, 2020 15:08
@sappelhoff sappelhoff changed the title BrainVision reader is broken for reading channel names that contain a comma in BV encoding FIX: Support commas in BrainVision channel names, event types, and event descriptions Nov 6, 2020
@sappelhoff sappelhoff changed the title FIX: Support commas in BrainVision channel names, event types, and event descriptions [MRG] FIX: Support commas in BrainVision channel names, event types, and event descriptions Nov 6, 2020
@sappelhoff
Copy link
Member Author

Would this PR be eligible for a backport? It may come in handy for the pybv package.

@larsoner
Copy link
Member

larsoner commented Nov 6, 2020

Sure but we just cut 0.21.1 yesterday so it might be a few weeks or so until we do a 0.21.2

@sappelhoff
Copy link
Member Author

indeed, on Windows, the temporary file-replacement for testing is not working as expected:

The windows tests only fail with:

mne\io\brainvision\tests\test_brainvision.py:304: in test_ch_names_comma
    assert nperformed_replacements == len(replace_dict)
E   assert 1 == 2
E     +1
E     -2

@sappelhoff sappelhoff requested a review from cbrnr November 8, 2020 10:24
@sappelhoff
Copy link
Member Author

@cbrnr could you please have a look at this one and merge if you are happy?

Then I can switch on the corresponding test on pybv with @requires_version("mne", "0.22")

doc/changes/latest.inc Outdated Show resolved Hide resolved
@cbrnr
Copy link
Contributor

cbrnr commented Nov 8, 2020

I'll merge once CIs come back green.

@cbrnr
Copy link
Contributor

cbrnr commented Nov 8, 2020

Not sure what's up with the failing test. It stopped after mne/tests/test_report.py::test_render_add_sections[mayavi] PASSED [ 75%], but it doesn't say which test failed and why.

@sappelhoff
Copy link
Member Author

I don't know either. 🤷‍♂️ but it passed before and it passes locally

@cbrnr
Copy link
Contributor

cbrnr commented Nov 8, 2020

I'll re-run and see if this magically resolves the issue (it often does).

@cbrnr
Copy link
Contributor

cbrnr commented Nov 8, 2020

Now Travis fails at the same test (mne/tests/test_report.py::test_render_add_sections[pyvista] Traceback (most recent call last):)? I'd like to clarify this before merging. @larsoner do you have any idea?

@GuillaumeFavelier
Copy link
Contributor

Now Travis fails at the same test

It's related to #8494

I'm working on a fix.

@sappelhoff
Copy link
Member Author

@cbrnr I rebased on Guillaume's fix and CIs pass now :-)

@cbrnr cbrnr merged commit bb16a3e into mne-tools:master Nov 9, 2020
@cbrnr
Copy link
Contributor

cbrnr commented Nov 9, 2020

Thanks @sappelhoff!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants