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
4 changes: 3 additions & 1 deletion doc/changes/latest.inc
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ Enhancements
- :class:`~mne.Epochs` metadata tables are now included in :class:`mne.Report` (:gh:`10166` by `Richard Höchenberger`_)

- :func:`mne.get_head_surf` and :func:`mne.dig_mri_distances` gained a new parameter, ``on_defects``, controlling how to handle surfaces with topological defects (:gh:`10175` by `Richard Höchenberger`_)

- :meth:`mne.Report.add_epochs` gained a new parameter, ``drop_log_ignore``, to control which drop reasons to omit when creating the drop log plot (:gh:`10182` by `Richard Höchenberger`_)

- :meth:`mne.Epochs.plot_drop_log` now also includes the absolute number of epochs dropped in the title (:gh:`10186` by `Richard Höchenberger`_)
Expand Down Expand Up @@ -155,6 +155,8 @@ Bugs

- :meth:`mne.Report.add_trans` now also works if no digitization points are present in the data (:gh:`10176` by `Jeff Stout`_)

- Argument ``verbose`` is now respected by dataset fetching (:gh:`10210` by `Mathieu Scheltienne`_)

- :func:`mne.gui.coregistration` now works with surfaces containing topological defects (:gh:`10230`, by `Richard Höchenberger`_)

API changes
Expand Down
2 changes: 1 addition & 1 deletion mne/datasets/_fake/_fake.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

@verbose
def data_path(path=None, force_update=False, update_path=False,
download=True, verbose=None): # noqa: D103
download=True, *, verbose=None): # noqa: D103
return _download_mne_dataset(
name='fake', processor='untar', path=path,
force_update=force_update, update_path=update_path,
Expand Down
8 changes: 4 additions & 4 deletions mne/datasets/_fetch.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@
#
# License: BSD Style.

import logging
import sys
import os
import os.path as op
from shutil import rmtree

from .. import __version__ as mne_version
from ..utils import logger, warn, _safe_input, _soft_import
from ..utils import logger, warn, _safe_input
from .config import (
_bst_license_text,
RELEASES,
Expand Down Expand Up @@ -127,8 +128,7 @@ def fetch_dataset(
multiple files must be downloaded and (optionally) uncompressed separately,
pass a list of dicts.
""" # noqa E501
# import pooch library for handling the dataset downloading
pooch = _soft_import("pooch", "dataset downloading", strict=True)
import pooch

if auth is not None:
if len(auth) != 2:
Expand Down Expand Up @@ -213,7 +213,7 @@ def fetch_dataset(
"You must agree to the license to use this " "dataset"
)
# downloader & processors
download_params = dict(progressbar=True) # use tqdm
download_params = dict(progressbar=logger.level <= logging.INFO)
if name == "fake":
download_params["progressbar"] = False
if auth is not None:
Expand Down
2 changes: 1 addition & 1 deletion mne/datasets/_fsaverage/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@


@verbose
def fetch_fsaverage(subjects_dir=None, verbose=None):
def fetch_fsaverage(subjects_dir=None, *, verbose=None):
"""Fetch and update fsaverage.

Parameters
Expand Down
2 changes: 1 addition & 1 deletion mne/datasets/_infant/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@


@verbose
def fetch_infant_template(age, subjects_dir=None, verbose=None):
def fetch_infant_template(age, subjects_dir=None, *, verbose=None):
"""Fetch and update an infant MRI template.

Parameters
Expand Down
4 changes: 2 additions & 2 deletions mne/datasets/brainstorm/bst_auditory.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@


@verbose
def data_path(path=None, force_update=False, update_path=True, download=True,
*, accept=False, verbose=None): # noqa: D103
def data_path(path=None, force_update=False, update_path=True,
download=True, accept=False, *, verbose=None): # noqa: D103
return _download_mne_dataset(
name='bst_auditory', processor='nested_untar', path=path,
force_update=force_update, update_path=update_path,
Expand Down
4 changes: 2 additions & 2 deletions mne/datasets/brainstorm/bst_phantom_ctf.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@


@verbose
def data_path(path=None, force_update=False, update_path=True, download=True,
*, accept=False, verbose=None): # noqa: D103
def data_path(path=None, force_update=False, update_path=True,
download=True, accept=False, *, verbose=None): # noqa: D103
return _download_mne_dataset(
name='bst_phantom_ctf', processor='nested_untar', path=path,
force_update=force_update, update_path=update_path,
Expand Down
4 changes: 2 additions & 2 deletions mne/datasets/brainstorm/bst_phantom_elekta.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@


@verbose
def data_path(path=None, force_update=False, update_path=True, download=True,
*, accept=False, verbose=None): # noqa: D103
def data_path(path=None, force_update=False, update_path=True,
download=True, accept=False, *, verbose=None): # noqa: D103
return _download_mne_dataset(
name='bst_phantom_elekta', processor='nested_untar', path=path,
force_update=force_update, update_path=update_path,
Expand Down
4 changes: 2 additions & 2 deletions mne/datasets/brainstorm/bst_raw.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@


@verbose
def data_path(path=None, force_update=False, update_path=True, download=True,
*, accept=False, verbose=None): # noqa: D103
def data_path(path=None, force_update=False, update_path=True,
download=True, accept=False, *, verbose=None): # noqa: D103
return _download_mne_dataset(
name='bst_raw', processor='nested_untar', path=path,
force_update=force_update, update_path=update_path,
Expand Down
4 changes: 2 additions & 2 deletions mne/datasets/brainstorm/bst_resting.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@


@verbose
def data_path(path=None, force_update=False, update_path=True, download=True,
*, accept=False, verbose=None): # noqa: D103
def data_path(path=None, force_update=False, update_path=True,
download=True, accept=False, *, verbose=None): # noqa: D103
return _download_mne_dataset(
name='bst_resting', processor='nested_untar', path=path,
force_update=force_update, update_path=update_path,
Expand Down
4 changes: 2 additions & 2 deletions mne/datasets/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,8 @@

MNE_DATASETS['sample'] = dict(
archive_name='MNE-sample-data-processed.tar.gz',
hash='md5:12b75d1cb7df9dfb4ad73ed82f61094f',
url='https://osf.io/86qa2/download?version=5',
hash='md5:e8f30c4516abdc12a0c08e6bae57409c',
url='https://osf.io/86qa2/download?version=6',
folder_name='MNE-sample-data',
config_key='MNE_DATASETS_SAMPLE_PATH',
)
Expand Down
7 changes: 3 additions & 4 deletions mne/datasets/eegbci/eegbci.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,13 @@

from ..utils import _get_path, _do_path_update
from ...utils import _url_to_local_path, verbose
from ...utils.check import _soft_import


EEGMI_URL = 'https://physionet.org/files/eegmmidb/1.0.0/'


@verbose
def data_path(url, path=None, force_update=False, update_path=None,
def data_path(url, path=None, force_update=False, update_path=None, *,
verbose=None):
"""Get path to local copy of EEGMMI dataset URL.

Expand Down Expand Up @@ -64,7 +63,7 @@ def data_path(url, path=None, force_update=False, update_path=None,
----------
.. footbibliography::
""" # noqa: E501
pooch = _soft_import('pooch', 'dataset downloading', True)
import pooch

key = 'MNE_DATASETS_EEGBCI_PATH'
name = 'EEGBCI'
Expand Down Expand Up @@ -155,7 +154,7 @@ def load_data(subject, runs, path=None, force_update=False, update_path=None,
----------
.. footbibliography::
""" # noqa: E501
pooch = _soft_import('pooch', 'dataset downloading', True)
import pooch

if not hasattr(runs, '__iter__'):
runs = [runs]
Expand Down
5 changes: 2 additions & 3 deletions mne/datasets/epilepsy_ecog/_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@


@verbose
def data_path(
path=None, force_update=False, update_path=True,
download=True, verbose=None): # noqa: D103
def data_path(path=None, force_update=False, update_path=True,
download=True, *, verbose=None): # noqa: D103
return _download_mne_dataset(
name='epilepsy_ecog', processor='untar', path=path,
force_update=force_update, update_path=update_path,
Expand Down
2 changes: 1 addition & 1 deletion mne/datasets/erp_core/erp_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

@verbose
def data_path(path=None, force_update=False, update_path=True,
download=True, verbose=None): # noqa: D103
download=True, *, verbose=None): # noqa: D103
return _download_mne_dataset(
name='erp_core', processor='untar', path=path,
force_update=force_update, update_path=update_path,
Expand Down
4 changes: 2 additions & 2 deletions mne/datasets/fieldtrip_cmc/fieldtrip_cmc.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@


@verbose
def data_path(path=None, force_update=False, update_path=True, download=True,
verbose=None): # noqa: D103
def data_path(path=None, force_update=False, update_path=True,
download=True, *, verbose=None): # noqa: D103
return _download_mne_dataset(
name='fieldtrip_cmc', processor='nested_unzip', path=path,
force_update=force_update, update_path=update_path,
Expand Down
4 changes: 2 additions & 2 deletions mne/datasets/fnirs_motor/fnirs_motor.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@


@verbose
def data_path(path=None, force_update=False, update_path=True, download=True,
verbose=None): # noqa: D103
def data_path(path=None, force_update=False, update_path=True,
download=True, *, verbose=None): # noqa: D103
return _download_mne_dataset(
name='fnirs_motor', processor='untar', path=path,
force_update=force_update, update_path=update_path,
Expand Down
2 changes: 1 addition & 1 deletion mne/datasets/hf_sef/hf_sef.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

@verbose
def data_path(dataset='evoked', path=None, force_update=False,
update_path=True, verbose=None):
update_path=True, *, verbose=None):
u"""Get path to local copy of the high frequency SEF dataset.

Gets a local copy of the high frequency SEF MEG dataset
Expand Down
4 changes: 2 additions & 2 deletions mne/datasets/kiloword/kiloword.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@


@verbose
def data_path(path=None, force_update=False, update_path=True, download=True,
verbose=None):
def data_path(path=None, force_update=False, update_path=True,
download=True, *, verbose=None):
"""Get path to local copy of the kiloword dataset.

This is the dataset from :footcite:`DufauEtAl2015`.
Expand Down
5 changes: 2 additions & 3 deletions mne/datasets/limo/limo.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,14 @@
from ...io.meas_info import create_info
from ...utils import _check_pandas_installed, verbose
from ..utils import _get_path, _do_path_update, logger
from ...utils.check import _soft_import


# root url for LIMO files
root_url = 'https://files.de-1.osf.io/v1/resources/52rea/providers/osfstorage/'


@verbose
def data_path(subject, path=None, force_update=False, update_path=None,
def data_path(subject, path=None, force_update=False, update_path=None, *,
verbose=None):
"""Get path to local copy of LIMO dataset URL.

Expand Down Expand Up @@ -67,7 +66,7 @@ def data_path(subject, path=None, force_update=False, update_path=None,
----------
.. footbibliography::
""" # noqa: E501
pooch = _soft_import('pooch', 'dataset downloading', True)
import pooch

downloader = pooch.HTTPDownloader(progressbar=True) # use tqdm

Expand Down
2 changes: 1 addition & 1 deletion mne/datasets/misc/_misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

@verbose
def data_path(path=None, force_update=False, update_path=True,
download=True, verbose=None): # noqa: D103
download=True, *, verbose=None): # noqa: D103
return _download_mne_dataset(
name='misc', processor='untar', path=path,
force_update=force_update, update_path=update_path,
Expand Down
4 changes: 2 additions & 2 deletions mne/datasets/mtrf/mtrf.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@


@verbose
def data_path(path=None, force_update=False, update_path=True, download=True,
verbose=None): # noqa: D103
def data_path(path=None, force_update=False, update_path=True,
download=True, *, verbose=None): # noqa: D103
return _download_mne_dataset(
name=data_name, processor='unzip', path=path,
force_update=force_update, update_path=update_path,
Expand Down
4 changes: 2 additions & 2 deletions mne/datasets/multimodal/multimodal.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@


@verbose
def data_path(path=None, force_update=False, update_path=True, download=True,
verbose=None): # noqa: D103
def data_path(path=None, force_update=False, update_path=True,
download=True, *, verbose=None): # noqa: D103
return _download_mne_dataset(
name='multimodal', processor='untar', path=path,
force_update=force_update, update_path=update_path,
Expand Down
4 changes: 2 additions & 2 deletions mne/datasets/opm/opm.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@


@verbose
def data_path(path=None, force_update=False, update_path=True, download=True,
verbose=None): # noqa: D103
def data_path(path=None, force_update=False, update_path=True,
download=True, *, verbose=None): # noqa: D103
return _download_mne_dataset(
name='opm', processor='untar', path=path,
force_update=force_update, update_path=update_path,
Expand Down
4 changes: 2 additions & 2 deletions mne/datasets/phantom_4dbti/phantom_4dbti.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@


@verbose
def data_path(path=None, force_update=False, update_path=True, download=True,
verbose=None): # noqa: D103
def data_path(path=None, force_update=False, update_path=True,
download=True, *, verbose=None): # noqa: D103
return _download_mne_dataset(
name='phantom_4dbti', processor='unzip', path=path,
force_update=force_update, update_path=update_path,
Expand Down
4 changes: 2 additions & 2 deletions mne/datasets/refmeg_noise/refmeg_noise.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@


@verbose
def data_path(path=None, force_update=False, update_path=True, download=True,
verbose=None): # noqa: D103
def data_path(path=None, force_update=False, update_path=True,
download=True, *, verbose=None): # noqa: D103
return _download_mne_dataset(
name='refmeg_noise', processor='unzip', path=path,
force_update=force_update, update_path=update_path,
Expand Down
5 changes: 2 additions & 3 deletions mne/datasets/sample/sample.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@


@verbose
def data_path(path=None, force_update=False, update_path=True, download=True,
verbose=None): # noqa: D103

def data_path(path=None, force_update=False, update_path=True,
download=True, *, verbose=None): # noqa: D103
return _download_mne_dataset(
name='sample', processor='untar', path=path,
force_update=force_update, update_path=update_path,
Expand Down
13 changes: 4 additions & 9 deletions mne/datasets/sleep_physionet/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@

import os
import os.path as op

import numpy as np

from ...utils import (verbose, _TempDir, _check_pandas_installed,
_on_missing)
from ...utils.check import _soft_import
from ..utils import _get_path

AGE_SLEEP_RECORDS = op.join(op.dirname(__file__), 'age_records.csv')
Expand All @@ -27,9 +27,7 @@


def _fetch_one(fname, hashsum, path, force_update, base_url):
# import pooch library for handling the dataset downloading
pooch = _soft_import('pooch', 'dataset downloading', strict=True)

import pooch
# Fetch the file
url = base_url + '/' + fname
destination = op.join(path, fname)
Expand Down Expand Up @@ -83,8 +81,7 @@ def _data_path(path=None, verbose=None):

def _update_sleep_temazepam_records(fname=TEMAZEPAM_SLEEP_RECORDS):
"""Help function to download Physionet's temazepam dataset records."""
# import pooch library for handling the dataset downloading
pooch = _soft_import('pooch', 'dataset downloading', strict=True)
import pooch

pd = _check_pandas_installed()
tmp = _TempDir()
Expand Down Expand Up @@ -144,9 +141,7 @@ def _update_sleep_temazepam_records(fname=TEMAZEPAM_SLEEP_RECORDS):

def _update_sleep_age_records(fname=AGE_SLEEP_RECORDS):
"""Help function to download Physionet's age dataset records."""
# import pooch library for handling the dataset downloading
pooch = _soft_import('pooch', 'dataset downloading', strict=True)

import pooch
pd = _check_pandas_installed()
tmp = _TempDir()

Expand Down
2 changes: 1 addition & 1 deletion mne/datasets/sleep_physionet/age.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

@verbose
def fetch_data(subjects, recording=(1, 2), path=None, force_update=False,
base_url=BASE_URL, on_missing='raise', verbose=None): # noqa: D301, E501
base_url=BASE_URL, on_missing='raise', *, verbose=None): # noqa: D301, E501
"""Get paths to local copies of PhysioNet Polysomnography dataset files.

This will fetch data from the publicly available subjects from PhysioNet's
Expand Down
Loading