mne.preprocessing.find_bad_channels_maxwell() features a crosstalk_file kwarg. Unlike in many (all?) other places in MNE, this argument cannot be a pathlib.Path object, and is required to be a string.
Scanning for bad channels in 12 intervals (5.0 sec) ...
Bad MEG channels being reconstructed: ['MEG 2443']
Processing 204 gradiometers and 102 magnetometers
Low-pass filtering data at 40.0 Hz
Static bad channels: []
[done]
[]
Actual results
~/Development/mne-python/mne/preprocessing/maxwell.py in _maxwell_filter(***failed resolving arguments***)
316 #
317 if cross_talk is not None:
--> 318 sss_ctc = _read_ctc(cross_talk)
319 ctc_chs = sss_ctc['proj_items_chs']
320 meg_ch_names = [info['ch_names'][p] for p in meg_picks]
~/Development/mne-python/mne/io/proc_history.py in _read_ctc(fname)
167 """Read cross-talk correction matrix."""
168 if not isinstance(fname, str) or not op.isfile(fname):
--> 169 raise ValueError('fname must be a file that exists, not %s' % fname)
170 f, tree, _ = fiff_open(fname)
171 with f as fid:
ValueError: fname must be a file that exists, not /Users/hoechenberger/mne_data/MNE-sample-data/SSS/ct_sparse_mgh.fif
Additional information
It works as expected when converting crosstalk_file to a string before passing it to find_bad_channels_maxwell().
Describe the bug
mne.preprocessing.find_bad_channels_maxwell()
features acrosstalk_file
kwarg. Unlike in many (all?) other places in MNE, this argument cannot be apathlib.Path
object, and is required to be a string.Steps to reproduce
Expected results
Actual results
Additional information
It works as expected when converting
crosstalk_file
to a string before passing it tofind_bad_channels_maxwell()
.