FIX: Montage Index error when importing CNT files#6025
Merged
agramfort merged 3 commits intomne-tools:masterfrom Mar 18, 2019
Merged
FIX: Montage Index error when importing CNT files#6025agramfort merged 3 commits intomne-tools:masterfrom
agramfort merged 3 commits intomne-tools:masterfrom
Conversation
839b993 to
49098a1
Compare
Codecov Report
@@ Coverage Diff @@
## master #6025 +/- ##
==========================================
+ Coverage 81.3% 87.34% +6.03%
==========================================
Files 402 402
Lines 73181 73162 -19
Branches 12163 12159 -4
==========================================
+ Hits 59503 63904 +4401
+ Misses 11021 6411 -4610
- Partials 2657 2847 +190 |
e35487f to
f58a20f
Compare
Contributor
Author
|
Just for the record, testing with some confidential files + some files on the web running the following import mne
import pytest
import os.path as op
from datetime import datetime
from mne import __file__ as _mne_file
from mne.tests.test_annotations import _assert_annotations_equal
regular_path = op.join(op.dirname(_mne_file), '..', 'sandbox', 'data')
confidential_path = op.join(regular_path, 'confidential', 'cnt')
flankers_path = op.join(regular_path, '914flankers.cnt')
cnt_files_with_eeglab_pair = [
op.join(confidential_path, 'BoyoAEpic1_16bit.cnt'),
op.join(confidential_path, 'cont_67chan_resp_32bit.cnt'),
op.join(confidential_path, 'SampleCNTFile_16bit.cnt')
]
def test_ensure_meas_date(recwarn):
raw = mne.io.read_raw_cnt(flankers_path, montage=None,
date_format='dd/mm/yy')
meas_date = (datetime
.fromtimestamp(raw.info['meas_date'][0])
.strftime('%d/%m/%y %H:%M:%S'))
assert meas_date == '23/09/07 12:22:15'
@pytest.mark.parametrize('fname', cnt_files_with_eeglab_pair, ids=op.basename)
def test_check_cnt_eeglab_pairs(fname, recwarn):
raw_eeglab = mne.io.read_raw_eeglab(fname.replace('.cnt', '.set'),
montage=None)
raw_cnt = mne.io.read_raw_cnt(fname, montage=None)
assert raw_cnt.info.keys() == raw_eeglab.info.keys()
xx = object_diff(raw_cnt.info, raw_eeglab.info)
print(xx)I get:
['chs'][63]['cal'] type mismatch (<class 'numpy.ndarray'>, <class 'float'>)
['chs'][63]['coord_frame'] value mismatch (4, 0)
['chs'][63]['loc'] array mismatch
['chs'][63]['unit_mul'] type mismatch (<class 'float'>, <class 'int'>)
['subject_info'] type mismatch (<class 'dict'>, <class 'NoneType'>) |
massich
commented
Mar 11, 2019
Contributor
Author
massich
left a comment
There was a problem hiding this comment.
Most probably I'm breaking something here.
4 tasks
56dc942 to
f08f77b
Compare
Contributor
Author
|
reading > stim_channel[event_time - 1] = event_id
E IndexError: index 583988 is out of bounds for axis 0 with size 582560in this PR: sandbox/mwe/5493_montage_index_error.py ✓ 100% ██████████
-------------------- generated xml file: /home/sik/code/mne-python/junit-results.xml --------------------
======================================= slowest 20 test durations =======================================
1.34s setup sandbox/mwe/5493_montage_index_error.py::test_foo
0.02s call sandbox/mwe/5493_montage_index_error.py::test_foo
(0.00 durations hidden. Use -vv to show these durations.)
Results (1.55s):
1 passed |
Contributor
Author
|
This PR goes after #6047 and misses whatsnew |
f08f77b to
50533ce
Compare
50533ce to
4f73d67
Compare
Contributor
Author
rootdir: /home/sik/code/mne-python, inifile: setup.cfg
plugins: timeout-1.3.3, sugar-0.9.2, mock-1.10.1, faulthandler-1.5.0, cov-2.6.1
timeout: 30.0s
timeout method: signal
timeout func_only: False
collecting ... 1526
sandbox/mwe/5493_montage_index_error.py ✓ 100% ██████████
--------------- generated xml file: /home/sik/code/mne-python/junit-results.xml ----------------
================================== slowest 20 test durations ===================================
1.29s setup sandbox/mwe/5493_montage_index_error.py::test_foo
0.01s call sandbox/mwe/5493_montage_index_error.py::test_foo
(0.00 durations hidden. Use -vv to show these durations.)
Results (1.62s):
1 passed
Compilation finished at Mon Mar 18 15:10:42It reads without error and recovers 1526 events |
agramfort
approved these changes
Mar 18, 2019
Member
|
thx @massich |
jeythekey
pushed a commit
to jeythekey/mne-python
that referenced
this pull request
Apr 27, 2019
* Fix: use annotations to create the backward compatible events * Fix: use the dataformat to parse int32 annotations * update whats_new
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #5493