docs: fix README cross-references; type _StatFn as a real Callable alias
Browse files- Fix broken Day-2 plan link (04-29→04-30, correct filename)
- Add Day-3 plan + mri_pipeline.py + test_mri_pipeline.py to "Where to Look"
- Extend Repository Layout tree with mri_pipeline.py (└──) entry
- Update fixtures/ description to list all three modality fixtures
- Broaden "All four BBB functions" prose to "All pipeline functions … Days 1–3"
- Bump timing claim from "under 2 seconds" to "under 4 seconds"
- Replace forward-ref string _StatFn with Callable[[np.ndarray], float] alias
- Add `from typing import Callable` to eeg_pipeline.py stdlib imports
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- README.md +8 -5
- src/pipelines/eeg_pipeline.py +3 -2
README.md
CHANGED
|
@@ -75,11 +75,12 @@ Result lives at `data/processed/mri_features.parquet` (48 ROI features per subje
|
|
| 75 |
│ ├── core/logger.py # Shared structured logger (mandatory in every pipeline)
|
| 76 |
│ ├── pipelines/
|
| 77 |
│ │ ├── bbb_pipeline.py # Day-1 pipeline (4 public funcs + CLI entry)
|
| 78 |
-
│ │
|
|
|
|
| 79 |
│ └── api/ # FastAPI surface (placeholder until Day 4+)
|
| 80 |
└── tests/
|
| 81 |
├── core/, pipelines/ # Mirror src/ structure
|
| 82 |
-
└── fixtures/
|
| 83 |
```
|
| 84 |
|
| 85 |
## BBB Pipeline (Day 1)
|
|
@@ -129,10 +130,10 @@ for the `float64` EEG features Day 2 produces. See AGENTS.md §6.
|
|
| 129 |
|
| 130 |
## Testing & TDD
|
| 131 |
|
| 132 |
-
All
|
| 133 |
REFACTOR). Each task ended in a green commit; review-and-fix loops landed as separate
|
| 134 |
commits with `fix:` / `refactor:` prefixes. Run `pytest -v` at any time — the full suite
|
| 135 |
-
finishes in under
|
| 136 |
|
| 137 |
## Roadmap
|
| 138 |
|
|
@@ -145,7 +146,9 @@ finishes in under 2 seconds on a 2024 laptop.
|
|
| 145 |
|
| 146 |
- **Project rules (mandatory reading for any agent):** [`AGENTS.md`](AGENTS.md)
|
| 147 |
- **Day-1 plan (full TDD task breakdown):** [`docs/superpowers/plans/2026-04-29-neurobridge-day1-bootstrap-bbb-pipeline.md`](docs/superpowers/plans/2026-04-29-neurobridge-day1-bootstrap-bbb-pipeline.md)
|
| 148 |
-
- **Day-2 plan (full TDD task breakdown):** [`docs/superpowers/plans/2026-04-
|
| 149 |
- **Logger contract:** [`src/core/logger.py`](src/core/logger.py) + [`tests/core/test_logger.py`](tests/core/test_logger.py)
|
| 150 |
- **BBB pipeline:** [`src/pipelines/bbb_pipeline.py`](src/pipelines/bbb_pipeline.py) + [`tests/pipelines/test_bbb_pipeline.py`](tests/pipelines/test_bbb_pipeline.py)
|
| 151 |
- **EEG pipeline:** [`src/pipelines/eeg_pipeline.py`](src/pipelines/eeg_pipeline.py) + [`tests/pipelines/test_eeg_pipeline.py`](tests/pipelines/test_eeg_pipeline.py)
|
|
|
|
|
|
|
|
|
| 75 |
│ ├── core/logger.py # Shared structured logger (mandatory in every pipeline)
|
| 76 |
│ ├── pipelines/
|
| 77 |
│ │ ├── bbb_pipeline.py # Day-1 pipeline (4 public funcs + CLI entry)
|
| 78 |
+
│ │ ├── eeg_pipeline.py # Day-2 pipeline (6 public funcs + CLI entry)
|
| 79 |
+
│ │ └── mri_pipeline.py # Day-3 pipeline (5 public funcs + CLI entry)
|
| 80 |
│ └── api/ # FastAPI surface (placeholder until Day 4+)
|
| 81 |
└── tests/
|
| 82 |
├── core/, pipelines/ # Mirror src/ structure
|
| 83 |
+
└── fixtures/ # bbbp_sample.csv, eeg_sample.fif, mri_sample/ + build_*.py
|
| 84 |
```
|
| 85 |
|
| 86 |
## BBB Pipeline (Day 1)
|
|
|
|
| 130 |
|
| 131 |
## Testing & TDD
|
| 132 |
|
| 133 |
+
All pipeline functions and the shared logger were built TDD-first across Days 1–3 (RED → GREEN →
|
| 134 |
REFACTOR). Each task ended in a green commit; review-and-fix loops landed as separate
|
| 135 |
commits with `fix:` / `refactor:` prefixes. Run `pytest -v` at any time — the full suite
|
| 136 |
+
finishes in under 4 seconds on a 2024 laptop.
|
| 137 |
|
| 138 |
## Roadmap
|
| 139 |
|
|
|
|
| 146 |
|
| 147 |
- **Project rules (mandatory reading for any agent):** [`AGENTS.md`](AGENTS.md)
|
| 148 |
- **Day-1 plan (full TDD task breakdown):** [`docs/superpowers/plans/2026-04-29-neurobridge-day1-bootstrap-bbb-pipeline.md`](docs/superpowers/plans/2026-04-29-neurobridge-day1-bootstrap-bbb-pipeline.md)
|
| 149 |
+
- **Day-2 plan (full TDD task breakdown):** [`docs/superpowers/plans/2026-04-30-day2-eeg-mne-ica-pipeline.md`](docs/superpowers/plans/2026-04-30-day2-eeg-mne-ica-pipeline.md)
|
| 150 |
- **Logger contract:** [`src/core/logger.py`](src/core/logger.py) + [`tests/core/test_logger.py`](tests/core/test_logger.py)
|
| 151 |
- **BBB pipeline:** [`src/pipelines/bbb_pipeline.py`](src/pipelines/bbb_pipeline.py) + [`tests/pipelines/test_bbb_pipeline.py`](tests/pipelines/test_bbb_pipeline.py)
|
| 152 |
- **EEG pipeline:** [`src/pipelines/eeg_pipeline.py`](src/pipelines/eeg_pipeline.py) + [`tests/pipelines/test_eeg_pipeline.py`](tests/pipelines/test_eeg_pipeline.py)
|
| 153 |
+
- **Day-3 plan (full TDD task breakdown):** [`docs/superpowers/plans/2026-05-01-day3-mri-combat-pipeline.md`](docs/superpowers/plans/2026-05-01-day3-mri-combat-pipeline.md)
|
| 154 |
+
- **MRI pipeline:** [`src/pipelines/mri_pipeline.py`](src/pipelines/mri_pipeline.py) + [`tests/pipelines/test_mri_pipeline.py`](tests/pipelines/test_mri_pipeline.py)
|
src/pipelines/eeg_pipeline.py
CHANGED
|
@@ -14,6 +14,7 @@ from __future__ import annotations
|
|
| 14 |
|
| 15 |
import os
|
| 16 |
from pathlib import Path
|
|
|
|
| 17 |
|
| 18 |
import mne
|
| 19 |
import numpy as np
|
|
@@ -215,8 +216,8 @@ def _band_power(freqs: np.ndarray, psd: np.ndarray, lo: float, hi: float) -> flo
|
|
| 215 |
# `STATS` tuple below is derived from this list so labels and computations
|
| 216 |
# can never drift out of sync (a class of bug the original parallel-list
|
| 217 |
# design was vulnerable to).
|
| 218 |
-
|
| 219 |
-
|
| 220 |
|
| 221 |
|
| 222 |
def _stat_mean(x: np.ndarray) -> float:
|
|
|
|
| 14 |
|
| 15 |
import os
|
| 16 |
from pathlib import Path
|
| 17 |
+
from typing import Callable
|
| 18 |
|
| 19 |
import mne
|
| 20 |
import numpy as np
|
|
|
|
| 216 |
# `STATS` tuple below is derived from this list so labels and computations
|
| 217 |
# can never drift out of sync (a class of bug the original parallel-list
|
| 218 |
# design was vulnerable to).
|
| 219 |
+
_StatFn = Callable[[np.ndarray], float]
|
| 220 |
+
_STATS_FUNCS: tuple[tuple[str, _StatFn], ...] # populated below
|
| 221 |
|
| 222 |
|
| 223 |
def _stat_mean(x: np.ndarray) -> float:
|