Commit 48cdd8d
committed
FIX: guarantee MNE sample data is bundled into JupyterLite build
Two coordinated fixes for the FileNotFoundError on /drive/mne_data
that crashes every intro notebook when run in the CircleCI preview.
.circleci/config.yml:
Add an explicit 'Ensure MNE sample data for JupyterLite' step
immediately before 'make html'. The existing circleci_download.sh
script only downloads sample data when the modified tutorial files
reference it via a text-grep check, so any PR that touches only
configuration files (like this one) would result in a cache miss
leaving ~/mne_data/MNE-sample-data absent. Without that directory
conf.py cannot copy the required files into jupyterlite_contents/,
/drive/mne_data never exists in the Pyodide virtual filesystem, and
mne.datasets.sample.data_path() throws FileNotFoundError on the
first meaningful cell of every tutorial notebook. The new step calls
mne.datasets.sample.data_path(update_path=True) unconditionally,
downloading the dataset if the cache is cold and skipping silently
if it is already present.
doc/conf.py:
Always create the jupyterlite_contents/mne_data/MNE-sample-data
destination directory unconditionally (dst_sample_data.mkdir) before
the copy loop runs, so /drive/mne_data is present in the Pyodide
kernel's Emscripten virtual filesystem even if no files were copied.
Also drop the 'not d.exists()' guard on individual file copies so
each incremental Sphinx build refreshes the bundled data files from
the current state of ~/mne_data/MNE-sample-data rather than skipping
files that were already copied from a previous build run.1 parent d349a16 commit 48cdd8d
2 files changed
Lines changed: 16 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
249 | 249 | | |
250 | 250 | | |
251 | 251 | | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
252 | 262 | | |
253 | 263 | | |
254 | 264 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
479 | 479 | | |
480 | 480 | | |
481 | 481 | | |
482 | | - | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
483 | 485 | | |
484 | 486 | | |
485 | 487 | | |
486 | 488 | | |
487 | 489 | | |
488 | 490 | | |
489 | 491 | | |
| 492 | + | |
490 | 493 | | |
491 | 494 | | |
492 | 495 | | |
| |||
506 | 509 | | |
507 | 510 | | |
508 | 511 | | |
509 | | - | |
| 512 | + | |
510 | 513 | | |
511 | 514 | | |
512 | 515 | | |
| 516 | + | |
513 | 517 | | |
514 | 518 | | |
515 | 519 | | |
| |||
0 commit comments