mne-bids-pipeline: Configuration TypeError

Custom config block contains

...
process_er = True
noise_cov = 'emptyroom'

python ~/Github/mne-study-template/run.py --config ~/.../custom_config.py throws TypeError as such

Traceback (most recent call last): File “/Users/ktavabi/Github/mne-study-template/run.py”, line 188, in <module> fire.Fire(process) File “/Users/ktavabi/miniconda3/lib/python3.8/site-packages/fire/core.py”, line 141, in Fire component_trace = _Fire(component, args, parsed_flag_args, context, name) File “/Users/ktavabi/miniconda3/lib/python3.8/site-packages/fire/core.py”, line 466, in _Fire component, remaining_args = _CallAndUpdateTrace( File “/Users/ktavabi/miniconda3/lib/python3.8/site-packages/fire/core.py”, line 681, in _CallAndUpdateTrace component = fn(*varargs, **kwargs) File “/Users/ktavabi/Github/mne-study-template/run.py”, line 183, in process _run_script(script_path, config, root_dir, subject, session, task, run) File “/Users/ktavabi/Github/mne-study-template/run.py”, line 92, in _run_script runpy.run_path(script_path, run_name=‘main’) File “/Users/ktavabi/miniconda3/lib/python3.8/runpy.py”, line 265, in run_path return _run_module_code(code, init_globals, run_name, File “/Users/ktavabi/miniconda3/lib/python3.8/runpy.py”, line 97, in _run_module_code _run_code(code, mod_globals, init_globals, File “/Users/ktavabi/miniconda3/lib/python3.8/runpy.py”, line 87, in _run_code exec(code, run_globals) File “/Users/ktavabi/Github/mne-study-template/scripts/init/00-init_derivatives_dir.py”, line 10, in <module> import config File “/Users/ktavabi/Github/mne-study-template/config.py”, line 1202, in <module> if isinstance(noise_cov, str) and noise_cov != ‘emptyroom’: TypeError: isinstance() arg 2 must be a type or tuple of types

Suggestion/advice appreciated.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 21 (21 by maintainers)

Most upvoted comments

PS my VM IDE (VSCode) is throwing this weirdo:

SyntaxError: Non-ASCII character ‘\xe2’ in file /Users/ktavabi/Github/mne-study-template/run.py on line 62, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details

I’d almost assume that VS Code, here, is simply using the wrong Python environment – some global Python 2.7 interpreter.

it’s really weird.

do you maybe have 2 version of python available on your system?

when you do

python --version

in the same terminal that crashes what do you get?

PS my VM IDE (VSCode) is throwing this weirdo:

SyntaxError: Non-ASCII character ‘\xe2’ in file /Users/ktavabi/Github/mne-study-template/run.py on line 62, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details

This is the Unicode character “–” (en-dash), used in a comment.

It’s interesting Python complains for you, as Unicode is the default for Python 3 files … Do you have any of the LOCALE, LC_CTYPE, LC_ALL, or LANGUAGE environment variables set?

hi @ktavabi

can you share your custom_config.py file?

I am wondering if you did not call a variable str which overwrites the type string