Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sappelhoff committed Sep 10, 2018
1 parent 98cd53b commit 9ee36dd
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
4 changes: 2 additions & 2 deletions mne_bids/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def _parse_ext(raw_fname, verbose=False):


def _read_raw(raw_fname, electrode=None, hsp=None, hpi=None, config=None,
verbose=None):
montage=None, verbose=None):
"""Read a raw file into MNE, making inferences based on extension."""
fname, ext = _parse_ext(raw_fname)

Expand Down Expand Up @@ -75,7 +75,7 @@ def _read_raw(raw_fname, electrode=None, hsp=None, hpi=None, config=None,

# Neuroscan .cnt format
elif ext == '.cnt':
raw = io.read_raw_cnt(raw_fname)
raw = io.read_raw_cnt(raw_fname, montage=montage)

# No supported data found ...
# ---------------------------
Expand Down
4 changes: 2 additions & 2 deletions mne_bids/mne_bids.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ def _scans_tsv(raw, raw_fname, fname, verbose):
"""
# get MEASurement date from the data info
meas_date = raw.info['meas_date']
if isinstance(meas_date, (np.ndarray, list)):
if isinstance(meas_date, (np.ndarray, list, tuple)):
meas_date = meas_date[0]

if meas_date is None:
Expand Down Expand Up @@ -575,7 +575,7 @@ def raw_to_bids(subject_id, task, raw_file, output_path, session_id=None,
data_meta_fname = make_bids_filename(
subject=subject_id, session=session_id, task=task, run=run,
suffix='%s.json' % kind, prefix=data_path)
if ext in ['.fif', '.ds', '.vhdr', '.edf', '.bdf']:
if ext in ['.fif', '.ds', '.vhdr', '.edf', '.bdf', '.set', '.cnt']:
raw_file_bids = make_bids_filename(
subject=subject_id, session=session_id, task=task, run=run,
suffix='%s%s' % (kind, ext))
Expand Down
7 changes: 7 additions & 0 deletions mne_bids/tests/test_mne_bids.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,5 +193,12 @@ def test_set():
def test_cnt():
"""Test raw_to_bids conversion for Neuroscan data."""
output_path = _TempDir()
data_path = op.join(testing.data_path(), 'CNT')
raw_fname = op.join(data_path, 'scan41_short.cnt')

raw_to_bids(subject_id=subject_id, session_id=session_id, run=run,
task=task, raw_file=raw_fname, output_path=output_path,
overwrite=True, kind='eeg')

cmd = ['bids-validator', '--bep006', output_path]
run_subprocess(cmd, shell=shell)

0 comments on commit 9ee36dd

Please sign in to comment.