Skip to content

Create lite-data dataset for JupyterLite #14041

Closed

Description

@natinew77-creator

Problem

The JupyterLite docs build currently downloads the full sample dataset (and a few others) just to serve a small handful of files to the browser notebooks. Those files then get bundled into the documentation build, which bloats it.

Streaming directly from OSF at runtime isn't possible: Pyodide runs in a web worker and OSF doesn't send CORS headers, so the fetch fails from the browser.

Proposal

Create a small curated dataset — lite-data — containing only the files the JupyterLite notebooks actually need (a slim subset of sample). Host it on OSF as its own dataset.

Since OSF supports downloading individual files, we could add something like mne.datasets.lite_data that fetches only the required files rather than pulling the whole sample dataset. Any mne.datasets.* calls in the notebooks could then be pointed at lite-data instead of the full dataset.

This would cut down both the download at build time and what gets bundled with the docs.

Relevant code: mne/datasets/_fetch.py (uses pooch) and mne/datasets/utils/.

Context: PR #13925.

cc @teonbrooks

Activity

  1. palakbhati commented on Jul 11, 2026

    @palakbhati

    Hi @teonbrooks, I'd like to work on this if it's still open.

    My approach: audit the JupyterLite notebooks to identify the exact files from sample (and any other datasets) they actually touch, curate those into a new lite-data OSF project, then add a mne.datasets.lite_data fetcher in mne/datasets/_fetch.py following the existing pooch-based pattern used for other datasets. I'll update the affected notebooks to point at lite_data instead of the full dataset, and check the docs build size before/after to confirm the reduction.

    I'll start by going through PR #13925 and the notebooks under the JupyterLite docs build to scope the file list.

  2. drammock commented on Jul 11, 2026

    @drammock
    Member

    @palakbhati this is party of an ongoing GSoC project by @natinew77-creator, so it would be better if you chose an issue not related to jupyterlite

  3. teonbrooks commented on Jul 17, 2026

    @teonbrooks
    Member

    hey @natinew77-creator, I agree with the approach to create the mne.datasets.lite_data fetcher. this way we can rely on the same data source but speed up the build and the files needed for the examples to run.

    we can add this as one of the subtasks for the #13929.

  4. natinew77-creator commented on Jul 19, 2026

    @natinew77-creator
    ContributorAuthor

    hey @natinew77-creator, I agree with the approach to create the mne.datasets.lite_data fetcher. this way we can rely on the same data source but speed up the build and the files needed for the examples to run.

    we can add this as one of the subtasks for the #13929.

    Thanks @teonbrooks! Will do, I'll track it under #13929 and start on the lite_data fetcher, using the file list I already scoped out in #13925.

  5. teonbrooks commented on Jul 21, 2026

    @teonbrooks
    Member

    @larsoner or @drammock, for the Jupyterlite support, we would like to host a subset of the sample dataset. we were planning to use the original files and just point to those but @natinew77-creator pointed out to me that they're all currently zipped on OSF.

    I suspect this means we would need to re-host a small version. how should we go about hosting this? within the same project?

  6. larsoner commented on Jul 21, 2026

    @larsoner
    Member

    It's trivial for me to upload a new .tar.gz to the MNE org on OSF. Just upload what you want to DropBox or somewhere else, I'll download it, and then add it to osf.io. If we end up needing to iterate more I could give you access as well @teonbrooks

  7. natinew77-creator commented on Jul 21, 2026

    @natinew77-creator
    ContributorAuthor

    It's trivial for me to upload a new .tar.gz to the MNE org on OSF. Just upload what you want to DropBox or somewhere else, I'll download it, and then add it to osf.io. If we end up needing to iterate more I could give you access as well @teonbrooks

    Thanks @larsoner! packaged it up, MNE-lite-data.tar.gz, 36 files (curated subset of sample + kiloword/erp_core/mtrf/eegbci) in canonical layout. here's the link:
    https://drive.google.com/file/d/1VjhWfNFBBn8S5y-7QqxywtaskDpLUgX5/view?usp=sharing
    and yeah access to iterate later would be great, thanks!

  8. larsoner commented on Jul 21, 2026

    @larsoner
    Member
  9. natinew77-creator commented on Jul 21, 2026

    @natinew77-creator
    ContributorAuthor
  10. natinew77-creator commented on Aug 2, 2026

    @natinew77-creator
    ContributorAuthor

    Implemented in #13925, so closing this.

    mne.datasets.lite_data follows the standard dataset pattern and is registered in mne/datasets/config.py. Thanks @larsoner for hosting the archive https://osf.io/rxvq7/files/a8qbx. It extracts to MNE-lite-data/ with files under their original dataset folders, so paths match the full datasets.

    One refinement worth noting: the build resolves each file from the real dataset first and falls back to the curated archive. The archive only holds what it was published with, so files added to the build afterwards were silently going missing. This way new files resolve straight away, and the archive still covers builds without the full datasets, which keeps the original goal of not downloading several GB.

    If the archive is refreshed to cover everything the build needs, that fallback can go and the curated set becomes the single source again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions