Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions doc/changes/latest.inc
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ Bugs

- We now display a scrollbar in the tags dropdown of a `~mne.Report` if many tags have been added, granting access to all tags instead of "hiding" them below the bottom of the page (:gh:`10082` by `Richard Höchenberger`_)

- Remove repeated logging output when overwriting an existing `~mne.io.Raw` file (:gh:`10095` by `Richard Höchenberger`_ and `Stefan Appelhoff`_)

API changes
~~~~~~~~~~~
- ``mne.Info.pick_channels`` has been deprecated. Use ``inst.pick_channels`` to pick channels from Raw|Epochs|Evoked. Use :func:`mne.pick_info` to pick channels from :class:`mne.Info` (:gh:`10039` by `Mathieu Scheltienne`_)
Expand Down
5 changes: 3 additions & 2 deletions mne/io/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1427,7 +1427,7 @@ def save(self, fname, picks=None, tmin=0, tmax=None, buffer_size_sec=None,
endings_err = ('.fif', '.fif.gz')

# convert to str, check for overwrite a few lines later
fname = _check_fname(fname, overwrite=True)
fname = _check_fname(fname, overwrite=True, verbose="error")
check_fname(fname, 'raw', endings, endings_err=endings_err)

split_size = _get_split_size(split_size)
Expand Down Expand Up @@ -1455,7 +1455,8 @@ def save(self, fname, picks=None, tmin=0, tmax=None, buffer_size_sec=None,
'"double", not "short"')

# check for file existence and expand `~` if present
fname = _check_fname(fname=fname, overwrite=overwrite)
fname = _check_fname(fname=fname, overwrite=overwrite,
verbose="error")

if proj:
info = deepcopy(self.info)
Expand Down
5 changes: 3 additions & 2 deletions mne/utils/check.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import numpy as np

from ..fixes import _median_complex, _compare_version
from ._logging import warn, logger
from ._logging import warn, logger, verbose


def _ensure_int(x, name='unknown', must_be='an int'):
Expand Down Expand Up @@ -147,8 +147,9 @@ def _check_event_id(event_id, events):
return event_id


@verbose
def _check_fname(fname, overwrite=False, must_exist=False, name='File',
need_dir=False):
need_dir=False, *, verbose=None):
"""Check for file existence, and return string of its absolute path."""
_validate_type(fname, 'path-like', name)
fname = str(
Expand Down