.
├── __init__.py
├── __pycache__
│ ├── __init__.cpython-36.pyc
│ └── test_bti.cpython-36.pyc
└── test_bti.py
1 directory, 4 files
pytest mne_bids/tests/test_mne_bids.py::test_bti --verbose
Test session starts (platform: linux, Python 3.6.6, pytest 3.6.2, pytest-sugar 0.9.1)
cachedir: .pytest_cache
rootdir: /home/stefanappelhoff/Desktop/mne-bids, inifile:
plugins: sugar-0.9.1, faulthandler-1.5.0, cov-2.5.1
――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― test_bti ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
def test_bti():
"""Test functionality of the raw_to_bids conversion for BTi data."""
output_path = _TempDir()
data_path = op.join(base_path, 'bti', 'tests', 'data')
raw_fname = op.join(data_path, 'test_pdf_linux')
config_fname = op.join(data_path, 'test_config_linux')
headshape_fname = op.join(data_path, 'test_hs_linux')
raw_to_bids(subject_id=subject_id, session_id=session_id, run=run,
task=task, raw_file=raw_fname, config=config_fname,
hsp=headshape_fname, output_path=output_path,
> verbose=True, overwrite=True)
mne_bids/tests/test_mne_bids.py:116:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
mne_bids/mne_bids.py:425: in raw_to_bids
config=config, verbose=verbose)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
raw_fname = '/home/stefanappelhoff/miniconda3/envs/mne/lib/python3.6/site-packages/mne/io/bti/tests/data/test_pdf_linux', electrode = None
hsp = '/home/stefanappelhoff/miniconda3/envs/mne/lib/python3.6/site-packages/mne/io/bti/tests/data/test_hs_linux', hpi = None
config = '/home/stefanappelhoff/miniconda3/envs/mne/lib/python3.6/site-packages/mne/io/bti/tests/data/test_config_linux', verbose = True
def _read_raw(raw_fname, electrode=None, hsp=None, hpi=None, config=None,
verbose=None):
"""Read a raw file into MNE, making inferences based on extension."""
fname, ext = _parse_ext(raw_fname)
# MEG File Types
# --------------
# KIT systems
if ext in ['.con', '.sqd']:
raw = io.read_raw_kit(raw_fname, elp=electrode, hsp=hsp,
mrk=hpi, preload=False)
# Neuromag or converted-to-fif systems
elif ext in ['.fif', '.gz']:
raw = io.read_raw_fif(raw_fname, preload=False)
# BTi systems
elif ext == '.pdf':
print(raw_fname)
if os.path.isfile(raw_fname):
raw = io.read_raw_bti(raw_fname, config_fname=config,
head_shape_fname=hsp,
preload=False, verbose=verbose)
# CTF systems
elif ext == '.ds':
raw = io.read_raw_ctf(raw_fname)
# EEG File Types
# --------------
# BrainVision format by Brain Products, expects also a .eeg and .vmrk file
elif ext == '.vhdr':
raw = io.read_raw_brainvision(raw_fname)
# EDF (european data format) or BDF (biosemi) format
elif ext == '.edf' or ext == '.bdf':
raw = io.read_raw_edf(raw_fname)
# EEGLAB .set format, if there is a separate .fdt file, it should be in the
# same folder as the .set file
elif ext == '.set':
raw = io.read_raw_eeglab(raw_fname)
# Neuroscan .cnt format
elif ext == '.cnt':
raw = io.read_raw_cnt(raw_fname)
# No supported data found ...
# ---------------------------
else:
raise ValueError("Raw file name extension must be one of %\n"
"Got %" % (ALLOWED_EXTENSIONS, ext))
> return raw
E UnboundLocalError: local variable 'raw' referenced before assignment
mne_bids/io.py:82: UnboundLocalError
------------------------------------------------------------------------------------------- Captured stdout call -------------------------------------------------------------------------------------------
/home/stefanappelhoff/miniconda3/envs/mne/lib/python3.6/site-packages/mne/io/bti/tests/data/test_pdf_linux
mne_bids/tests/test_mne_bids.py::test_bti ⨯ 100% ██████████
Results (0.42s):
1 failed
- mne_bids/tests/test_mne_bids.py:105 test_bti