|
11 | 11 |
|
12 | 12 | import faulthandler |
13 | 13 | import os |
| 14 | +import re |
| 15 | +import shutil |
14 | 16 | import subprocess |
15 | 17 | import sys |
16 | 18 | from datetime import datetime, timezone |
|
477 | 479 | jupyterlite_contents = ["jupyterlite_contents"] |
478 | 480 | jupyterlite_bind_ipynb_suffix = False |
479 | 481 |
|
480 | | -import pathlib |
481 | | -import shutil |
482 | | - |
483 | 482 | # Automatically inject the required subset of MNE-sample-data into JupyterLite |
484 | | -src_sample_data = pathlib.Path(os.path.expanduser("~/mne_data/MNE-sample-data")) |
| 483 | +src_sample_data = Path(os.path.expanduser("~/mne_data/MNE-sample-data")) |
485 | 484 | dst_sample_data = ( |
486 | | - pathlib.Path(os.path.abspath(os.path.dirname(__file__))) |
| 485 | + Path(os.path.abspath(os.path.dirname(__file__))) |
487 | 486 | / "jupyterlite_contents" |
488 | 487 | / "mne_data" |
489 | 488 | / "MNE-sample-data" |
|
521 | 520 | with open(pyproject_path, encoding="utf-8") as f: |
522 | 521 | orig_pyproject = f.read() |
523 | 522 |
|
524 | | -import re |
525 | | - |
526 | 523 | # Relax constraints for Pyodide which often lags behind PyPI |
527 | 524 | patched = re.sub(r'"scipy\s*>=\s*1\.13"', '"scipy >= 1.11"', orig_pyproject) |
528 | 525 | patched = re.sub(r'"matplotlib\s*>=\s*3\.9"', '"matplotlib >= 3.5"', patched) |
|
606 | 603 | "def pyodide_pooch_fetch(self, fname, processor=None, downloader=None):\n" |
607 | 604 | " url = self.get_url(fname)\n" |
608 | 605 | " if 'osf.io' in url or 'files.osf.io' in url:\n" |
609 | | - " print(f'Bypassing OSF download for {fname}. Using injected local cache.')\n" |
| 606 | + " print(f'Bypassing OSF download for" |
| 607 | + " {fname}. Using injected local cache.')\n" |
610 | 608 | " return orig_pooch_fetch(\n" |
611 | 609 | " self, fname, processor=processor, downloader=downloader\n" |
612 | 610 | " )\n" |
|
623 | 621 | " print('Corrupted MNE config deleted automatically.')\n" |
624 | 622 | " except Exception:\n" |
625 | 623 | " pass\n" |
626 | | - "for ds in ['SAMPLE', 'TESTING', 'SSVEP', 'EEGBCI', 'SOMATO', 'AUDIOVISUAL', 'BRAINSTORM']:\n" |
| 624 | + "for ds in ['SAMPLE', 'TESTING', 'SSVEP'," |
| 625 | + " 'EEGBCI', 'SOMATO', 'AUDIOVISUAL', 'BRAINSTORM']:\n" |
627 | 626 | " mne.set_config(f'MNE_DATASETS_{ds}_PATH', '/drive/mne_data')\n" |
628 | 627 | "import IPython\n" |
629 | 628 | "IPython.get_ipython().run_line_magic('matplotlib', 'inline')\n" |
|
0 commit comments