Skip to content

Commit

Permalink
ENH: Update downloader (#6751)
Browse files Browse the repository at this point in the history
  • Loading branch information
larsoner authored Sep 10, 2019
1 parent a7ef05d commit 13c8e69
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
5 changes: 4 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,10 @@ jobs:
python -c "import mne; print(mne.datasets.somato.data_path(update_path=True))";
fi;
if [[ $(cat $FNAME | grep -x ".*datasets.*eegbci.*" | wc -l) -gt 0 ]]; then
python -c "import mne; print(mne.datasets.eegbci.load_data(1, [6, 10, 14], update_path=True))";
python -c "import mne; print(mne.datasets.eegbci.load_data(1, [3, 6, 10, 14], update_path=True))";
python -c "import mne; print(mne.datasets.eegbci.load_data(2, [3], update_path=True))";
python -c "import mne; print(mne.datasets.eegbci.load_data(3, [3], update_path=True))";
python -c "import mne; print(mne.datasets.eegbci.load_data(4, [3], update_path=True))";
fi;
if [[ $(cat $FNAME | grep -x ".*datasets.*sleep_physionet.*" | wc -l) -gt 0 ]]; then
python -c "import mne; print(mne.datasets.sleep_physionet.age.fetch_data([0, 1], recording=[1], update_path=True))";
Expand Down
12 changes: 10 additions & 2 deletions mne/datasets/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -552,8 +552,14 @@ def has_dataset(name):
@verbose
def _download_all_example_data(verbose=True):
"""Download all datasets used in examples and tutorials."""
# This function is designed primarily to be used by CircleCI. It has
# verbose=True by default so we get nice status messages
# This function is designed primarily to be used by CircleCI, to:
#
# 1. Streamline data downloading
# 2. Make CircleCI fail early (rather than later) if some necessary data
# cannot be retrieved.
# 3. Avoid download statuses and timing biases in rendered examples.
#
# verbose=True by default so we get nice status messages.
# Consider adding datasets from here to CircleCI for PR-auto-build
from . import (sample, testing, misc, spm_face, somato, brainstorm,
eegbci, multimodal, opm, hf_sef, mtrf, fieldtrip_cmc,
Expand All @@ -580,6 +586,8 @@ def _download_all_example_data(verbose=True):
finally:
sys.argv.pop(-1)
eegbci.load_data(1, [6, 10, 14], update_path=True)
for subj in range(4):
eegbci.load_data(subj + 1, runs=[3], update_path=True)
sleep_physionet.age.fetch_data(subjects=[0, 1], recording=[1],
update_path=True)
# If the user has SUBJECTS_DIR, respect it, if not, set it to the EEG one
Expand Down

0 comments on commit 13c8e69

Please sign in to comment.