Download all datasets used in examples and tutorials.
(verbose=True)
| 327 | |
| 328 | @verbose |
| 329 | def _download_all_example_data(verbose=True): |
| 330 | """Download all datasets used in examples and tutorials.""" |
| 331 | # This function is designed primarily to be used by CircleCI, to: |
| 332 | # |
| 333 | # 1. Streamline data downloading |
| 334 | # 2. Make CircleCI fail early (rather than later) if some necessary data |
| 335 | # cannot be retrieved. |
| 336 | # 3. Avoid download statuses and timing biases in rendered examples. |
| 337 | # |
| 338 | # verbose=True by default so we get nice status messages. |
| 339 | # Consider adding datasets from here to CircleCI for PR-auto-build |
| 340 | import openneuro |
| 341 | |
| 342 | paths = dict() |
| 343 | for kind in ( |
| 344 | "sample testing misc spm_face somato hf_sef multimodal " |
| 345 | "fnirs_motor opm mtrf fieldtrip_cmc kiloword phantom_kit phantom_4dbti " |
| 346 | "refmeg_noise ssvep epilepsy_ecog ucl_opm_auditory eyelink " |
| 347 | "erp_core brainstorm.bst_raw brainstorm.bst_auditory " |
| 348 | "brainstorm.bst_resting brainstorm.bst_phantom_ctf " |
| 349 | "brainstorm.bst_phantom_elekta phantom_kernel" |
| 350 | ).split(): |
| 351 | mod = importlib.import_module(f"mne.datasets.{kind}") |
| 352 | data_path_func = getattr(mod, "data_path") |
| 353 | kwargs = dict() |
| 354 | if "accept" in inspect.getfullargspec(data_path_func).args: |
| 355 | kwargs["accept"] = True |
| 356 | paths[kind] = data_path_func(**kwargs) |
| 357 | logger.info(f"[done {kind}]") |
| 358 | |
| 359 | # Now for the exceptions: |
| 360 | from . import ( |
| 361 | eegbci, |
| 362 | fetch_fsaverage, |
| 363 | fetch_hcp_mmp_parcellation, |
| 364 | fetch_infant_template, |
| 365 | fetch_phantom, |
| 366 | limo, |
| 367 | sleep_physionet, |
| 368 | ) |
| 369 | |
| 370 | eegbci.load_data(subjects=1, runs=[6, 10, 14], update_path=True) |
| 371 | eegbci.load_data(subjects=range(1, 5), runs=[3], update_path=True) |
| 372 | logger.info("[done eegbci]") |
| 373 | |
| 374 | sleep_physionet.age.fetch_data(subjects=[0, 1], recording=[1]) |
| 375 | logger.info("[done sleep_physionet]") |
| 376 | |
| 377 | # If the user has SUBJECTS_DIR, respect it, if not, set it to the EEG one |
| 378 | # (probably on CircleCI, or otherwise advanced user) |
| 379 | fetch_fsaverage(subjects_dir=None) |
| 380 | logger.info("[done fsaverage]") |
| 381 | |
| 382 | # Now also update the sample dataset path, if not already SUBJECTS_DIR |
| 383 | # (some tutorials make use of these files) |
| 384 | fetch_fsaverage(subjects_dir=paths["sample"] / "subjects") |
| 385 | |
| 386 | fetch_infant_template("6mo") |
nothing calls this directly
no test coverage detected