# Pinned dependencies for the course notebooks (notebooks/requirements.txt). # The first cell of every notebook installs these (only when the pinned stack is # missing, e.g. on a fresh Colab kernel) so a clean environment runs # top to bottom. Versions match the environment the notebooks were executed in. # ---------------------------------------------------------------- core (all levels) mne==1.10.2 numpy>=2.1,<3 scipy>=1.15,<2 matplotlib>=3.9,<4 pooch>=1.8 pandas>=2.2,<3 # ds-brain-invaders (bi2014a) loader; only nb-1-5-filters needs it. moabb==1.7.2 # Execution / CI nbformat>=5.10 nbclient>=0.10 ipykernel>=6.29 # Spectral parameterization (nb-1-7-specparam, nb-c1-spectral-fingerprint, aperiodic widget PSDs); PyPI only has 2.0.0 release candidates. specparam==2.0.0rc4 # EDF writing for the nb-0-6-first-look-report exercise file (FIF fallback if absent). edfio>=0.4 # ------------------------------------------------- Level 2 (cleaning) and Level 3 (ERP) # Bad-channel detection: pyprep's NoisyChannels criteria (nb-2-2, nb-2-8, nb-c2). pyprep>=0.9,<1 # BIDS reading and the dataset report of nb-2-1 and nb-c2. mne-bids>=0.19,<1 # Threshold-free epoch rejection (nb-2-5, nb-3-1, nb-c2, nb-c3). autoreject>=0.5,<1 # ------------------------------------------------------- Level 6 (inference and rigor) # Linear mixed models on single-trial amplitudes (nb-6-2-lmm). The notebook detects its # absence and falls back to a documented two-stage estimator (fit the trial-level regression # inside each subject, then test the coefficients across subjects), printing which path it # took; the fallback cannot report variance components, the crossed subject-by-item model or # a likelihood comparison, and says so. Executed with statsmodels 0.14.4. statsmodels>=0.14,<1 # scikit-learn is already a transitive dependency of autoreject and mne-icalabel; nb-6-5-decoding # uses it directly (SlidingEstimator, GeneralizingEstimator, CSP, LogisticRegression), so it is # pinned explicitly rather than left to another package's resolution. Executed with 1.6.1. scikit-learn>=1.5,<2 # ------------------------------------------------------------------------- optional # Every notebook below runs without these; each one degrades to a documented # fallback and says in its output which path it took. # # ICLabel component classification (nb-2-6, nb-c2). Without it the notebook # falls back to the spatial/spectral heuristics in helpers_l2.classify_components, # which are less accurate and label fewer component classes. onnxruntime is # mne-icalabel's inference backend and has no wheel on some platforms. mne-icalabel>=0.9,<1 onnxruntime>=1.17 # Artifact Subspace Reconstruction (nb-2-7). Without it the notebook uses the # teaching NumPy implementation in the same notebook. The two are NOT # interchangeable -- see the TODO(confirm) in nb-2-7 recording that asrpy removes # far more signal than the documented method at the same cutoff. asrpy>=0.0.8 # ------------------------------------------------- Level 5 (connectivity and spatial analysis) # Spectral connectivity (nb-5-2, nb-5-3, nb-5-6, nb-c5). Optional: every Level 5 notebook that # uses it falls back to helpers_l5.connectivity_from_fourier, which implements coherence, # imaginary coherence, PLV, PLI and wPLI from the same Fourier coefficients and agrees with # spectral_connectivity_epochs(mode="fourier") to machine precision (the notebooks check this and # print which path they took). Pulls in netCDF4 and cftime. mne-connectivity==0.9.0 # ----------------------------------------------------------- Level 4 (time-frequency) # Level 4 adds no required dependency: specparam (pinned above for Level 1) covers # nb-4-6 and nb-c4, and everything else is MNE, SciPy and NumPy. # # Cycle-by-cycle waveform analysis (nb-4-6-bursts section 4). OPTIONAL: without it the # notebook uses the documented NumPy cycle segmentation written out in the same cell, # which measures the same two symmetry ratios but has no burst criterion of its own, and # it prints which path it took. bycycle pulls in neurodsp. bycycle>=1.1,<2 # ------------------------------------------------------ Level 7 (applied electives) # Riemannian-geometry classifiers (nb-7-1-moabb): Covariances, TangentSpace, Xdawn and # XdawnCovariances. moabb already pulls it in transitively; it is pinned explicitly # because nb-7-1 imports it directly and has NO fallback for its Riemannian arm. # Executed with 0.12. pyriemann>=0.8,<1 # Automatic sleep staging (nb-7-2-sleep). yasa ships its pre-trained LightGBM # classifiers inside the package, so nothing further is downloaded at import time; it # pulls in lightgbm, antropy and lspopt. Without it nb-7-2 falls back to # helpers_l7.trained_fallback_stage -- a shrinkage LDA over per-epoch band powers # trained on a DIFFERENT subject's night, which costs one extra 48 MB download and only # on that path -- and prints which path it took. On the night nb-7-2 scores, the # fallback reached Cohen's kappa 0.7849 against yasa's 0.7971, so the fallback is usable # and is NOT the answer to the L7.2 exercise. Executed with yasa 0.7.0, lightgbm 4.7.0. yasa>=0.7,<1 # YAML protocols for the course library loop/eegloop: nb-7-16 loads loop/configs/*.yaml through # eegloop.session.load_protocol, which imports PyYAML lazily and names it when missing. moabb already # pulls it in transitively; pinned explicitly for the reason this file's header states. Matches # loop/pyproject.toml's dev extra. PyYAML>=6.0,<7 # # OPTIONAL — the headset driver (nb-7-10, nb-7-11: the `SOURCE = 'device'` cells only). Every notebook # runs without it; it is installed as `pip install 'eegloop[brainflow]'` from loop/, never from here. # brainflow>=5.22,<6 # # DELIBERATELY NOT PINNED: braindecode and torch, for the compact CNN (EEGNet) arm that # spec section 6 L7.1 asks for. CONTRACTS.md says to avoid torch, and training EEGNet # for 9 subjects x 2 sessions x 5 folds plus leave-one-subject-out on a free-tier CPU # would not fit the spec section 11 ten-minute budget either. nb-7-1 runs filter-bank # CSP as its third pipeline instead and prints, in its own section 0, exactly what that # substitution does and does not answer. See helpers_l7.CNN_ARM. TODO(confirm) for the # author: pin them and add the arm, or reword the L7.1 objective.