Skip to content

Commit 4bd5a7c

Browse files
MAINT: stop serving somato and hide the six pages that read it
Its raw alone is 344 MB, 404 MB with the forward and surfaces, which is more than those six pages are worth on every docs deploy.
1 parent 2db2d5d commit 4bd5a7c

1 file changed

Lines changed: 17 additions & 33 deletions

File tree

doc/conf.py

Lines changed: 17 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -739,28 +739,8 @@ def _lite_copy_tree(folder, rel_dir):
739739
_lite_copy("MNE-multimodal-data", ["multimodal_raw.fif"])
740740
_lite_copy("MNE-refmeg-noise-data", ["sample_reference_MEG_noise-raw.fif"])
741741

742-
# Six notebooks use the somato dataset (the DICS/TF-MxNE examples and the
743-
# time-frequency tutorial). The full dataset is ~610 MB, but they only read one
744-
# raw, one forward solution and the FreeSurfer surfaces needed to draw the
745-
# source estimate, so copy just those. CircleCI already restores somato from
746-
# data-cache-somato for the native build, so nothing extra is downloaded.
747-
somato_files = [
748-
"sub-01/meg/sub-01_task-somato_meg.fif",
749-
"derivatives/sub-01/sub-01_task-somato-fwd.fif",
750-
"derivatives/freesurfer/subjects/01/surf/lh.inflated",
751-
"derivatives/freesurfer/subjects/01/surf/rh.inflated",
752-
"derivatives/freesurfer/subjects/01/surf/lh.curv",
753-
"derivatives/freesurfer/subjects/01/surf/rh.curv",
754-
]
755-
for somato_file in somato_files:
756-
s = _lite_src("MNE-somato-data", somato_file)
757-
d = lite_data_base / "MNE-somato-data" / somato_file
758-
if s is not None and not d.exists():
759-
d.parent.mkdir(parents=True, exist_ok=True)
760-
shutil.copy2(s, d)
761-
print(f"[JupyterLite] Copied {somato_file} ({s.stat().st_size / 1e6:.1f} MB)")
762-
elif s is None:
763-
print(f"[JupyterLite] MISSING {somato_file}")
742+
# somato is deliberately not served: its raw alone is 344 MB and the six
743+
# notebooks that read it are on the exclude list instead.
764744

765745
# Inject the single needed file(s) from extra datasets used by the Epochs and
766746
# decoding examples. Sizes are all within what we already serve
@@ -1024,15 +1004,9 @@ def _lite_copy_tree(folder, rel_dir):
10241004
"def _lite_mtrf_data_path(*_a, **_kw):\n"
10251005
" return _lite_lazy_fetch('mTRF_1.5', 'speech_data.mat')\n"
10261006
"mne.datasets.mtrf.data_path = _lite_mtrf_data_path\n"
1027-
"# somato just returns the folder: the notebooks reach its raw and\n"
1028-
"# forward files through read_raw_fif/read_forward_solution, which are\n"
1029-
"# already shimmed below to fetch anything under mne_data on first read.\n"
1030-
"def _lite_somato_data_path(*_a, **_kw):\n"
1031-
" return _Path(mne_data_path + '/MNE-somato-data')\n"
1032-
"mne.datasets.somato.data_path = _lite_somato_data_path\n"
1033-
"# testing follows somato: hand back the folder and let the shimmed\n"
1034-
"# readers pull individual files, so a notebook that wants the EEGLAB\n"
1035-
"# recording does not also drag down the 39 MB movement raw.\n"
1007+
"# testing hands back the folder and lets the shimmed readers pull\n"
1008+
"# individual files, so a notebook that wants the EEGLAB recording does\n"
1009+
"# not also drag down the 39 MB movement raw.\n"
10361010
"def _lite_testing_data_path(*_a, **_kw):\n"
10371011
" return _Path(mne_data_path + '/MNE-testing-data')\n"
10381012
"mne.datasets.testing.data_path = _lite_testing_data_path\n"
@@ -1370,8 +1344,8 @@ def _lite_copy_tree(folder, rel_dir):
13701344
" _sdir = (str(_sdir) if _sdir is not None else\n"
13711345
" mne_data_path + '/MNE-sample-data/subjects')\n"
13721346
" # surfaces are fetched relative to the served mne_data root, so\n"
1373-
" # derive that from subjects_dir instead of assuming sample --\n"
1374-
" # somato keeps its FreeSurfer subjects under its own folder.\n"
1347+
" # derive that from subjects_dir rather than assuming sample --\n"
1348+
" # a dataset may keep its FreeSurfer subjects under its own folder.\n"
13751349
" _rel_sdir = (_sdir[len(mne_data_path) + 1:]\n"
13761350
" if _sdir.startswith(mne_data_path + '/')\n"
13771351
" else 'MNE-sample-data/subjects')\n"
@@ -1868,6 +1842,16 @@ def _lite_copy_tree(folder, rel_dir):
18681842
"tutorials/inverse/70_eeg_mri_coords.py",
18691843
# mne_bids is not installable in the browser kernel
18701844
"tutorials/inverse/95_phantom_KIT.py",
1845+
# Tier 7 — somato. Serving it costs 404 MB (the raw alone is 344 MB) on
1846+
# every docs deploy, which is more than these six pages are worth; the
1847+
# dataset is not copied at all. Restoring them means putting the somato
1848+
# block back in the copy step above.
1849+
"examples/inverse/dics_epochs.py",
1850+
"examples/inverse/dics_source_power.py",
1851+
"examples/inverse/evoked_ers_source_power.py",
1852+
"examples/inverse/multidict_reweighted_tfmxne.py",
1853+
"examples/time_frequency/time_frequency_global_field_power.py",
1854+
"tutorials/time-freq/20_sensors_time_frequency.py",
18711855
# Single recordings well past LITE_MAX_FILE_MB, confirmed against the full
18721856
# build: 379 MB and 251 MB for one example each, so they are skipped by the
18731857
# copy step and the badge would have nothing to load.

0 commit comments

Comments
 (0)