Skip to content

Commit

Permalink
Make read_evokeds() expand "~" to home directory
Browse files Browse the repository at this point in the history
  • Loading branch information
hoechenberger committed May 28, 2022
1 parent b74d004 commit 4bff403
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions doc/changes/latest.inc
Expand Up @@ -122,6 +122,8 @@ Bugs

- In :func:`mne.preprocessing.find_bad_channels_maxwell`, do not re-filter the data if a low-pass filter with the requested frequency has already been applied (:gh:`xxx` by `Richard Höchenberger`_)

- :func:`mne.read_evokeds` now correctly expands ``~`` in the provided path to the user's home directory (:gh:`10685` by `Richard Höchenberger`_)

API and behavior changes
~~~~~~~~~~~~~~~~~~~~~~~~
- When creating BEM surfaces via :func:`mne.bem.make_watershed_bem` and :func:`mne.bem.make_flash_bem`, the ``copy`` parameter now defaults to ``True``. This means that instead of creating symbolic links inside the FreeSurfer subject's ``bem`` folder, we now create "actual" files. This should avoid troubles when sharing files across different operating systems and file systems (:gh:`10531` by `Richard Höchenberger`_)
Expand Down
5 changes: 3 additions & 2 deletions mne/evoked.py
Expand Up @@ -1110,8 +1110,8 @@ def read_evokeds(fname, condition=None, baseline=None, kind='average',
Parameters
----------
fname : str
The file name, which should end with -ave.fif or -ave.fif.gz.
fname : path-like
The file name, which should end with ``-ave.fif`` or ``-ave.fif.gz``.
condition : int or str | list of int or str | None
The index or list of indices of the evoked dataset to read. FIF files
can contain multiple datasets. If None, all datasets are returned as a
Expand Down Expand Up @@ -1159,6 +1159,7 @@ def read_evokeds(fname, condition=None, baseline=None, kind='average',
saving, this will be reflected in their ``baseline`` attribute after
reading.
"""
fname = _check_fname(fname, overwrite='read', must_exist=True)
check_fname(fname, 'evoked', ('-ave.fif', '-ave.fif.gz',
'_ave.fif', '_ave.fif.gz'))
logger.info('Reading %s ...' % fname)
Expand Down

0 comments on commit 4bff403

Please sign in to comment.