Repository navigation
Make the Cerebrovascular Reactivity Mapping page (ch06) execute on the tutorial data - #87
Conversation
Every code cell in 06_Cerebrovascular_Reactivity_Mapping.md referenced
files absent from the repo (manual_classification.tsv, optcom.nii.gz,
co2.phys, masks, ROI) plus a bare `raise ValueError("SKIP")`, so the
chapter could never execute during the build. Jupyter Book halts a
notebook at its first error, so only the manual_classification.tsv
FileNotFoundError surfaced.
Convert all {code-cell} ipython3 blocks to plain ```python blocks
(matching 08_ICA_Based_Denoising.md), making this an illustrative
tutorial the reader runs on their own data, and drop the SKIP hack.
Verified: ch06 no longer appears in _build/html/reports/content/ and the
book build exits 0.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR makes Chapter 06 (“Cerebrovascular Reactivity Mapping”) non-executable during the Jupyter Book build by converting MyST {code-cell} blocks into illustrative fenced python code blocks, removing the build-stopping execution failures caused by missing example data files.
Changes:
- Replaced
{code-cell} ipython3blocks with plain fenced```pythonblocks so the chapter renders as a runnable-on-your-own-data guide. - Removed the
raise ValueError("SKIP")execution hack by eliminating notebook execution of the chapter’s code blocks.
Comments suppressed due to low confidence (1)
content/06_Cerebrovascular_Reactivity_Mapping.md:48
- The fenced code block after the third bullet is no longer indented, so it will render outside the list item in Markdown/Jupyter Book. Also the example writes
accecpted_ic_timeseries.csv, which is inconsistent with later references toaccepted_ic_timeseries.csvand will cause a FileNotFoundError for readers following the tutorial.
```python
import pandas as pd
# Assuming RICA was used for manual classification, read the downloaded file (adjusting path as necessary)
man_class = pd.read_csv('../manual_classification.tsv', sep='\t', header=0)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…as example - The pandas example saved to '../accecpted_ic_timeseries.csv' (typo) while the phys2cvr calls read '../accepted_ic_timeseries.csv' — a reader following the tutorial would hit FileNotFoundError. Match the spelling. - Indent the first code block so it renders inside the list item that introduces it (it was at column 0, rendering outside the list). Verified it parses as a fenced python block nested in the list item. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Addressed the Copilot review feedback on the first code block (909b752):
Both were pre-existing in the chapter; folded them in here since the reviewer flagged them on the block this PR touches. |
|
No, sorry, I was about to write that it's a me issue as well now. I thought I copied another page example more closely, but probably I inserted some mistakes. Is there any action item I need to take care of? |
|
I was planning to work my way through this page and fix any missing paths, rather than disable the code cells. It may rely on files generated by the tedana workflow page (except for the manual classifications, which will need to be swapped out for the automatic ones from tedana). |
|
I don't have the bandwidth to fix the missing paths. This happens to be what I did to be able to build the book locally and I thought I'd open this to flag it. Again, feel free to work on it or close it. |
|
We'd also need a CO2 generated for and from peakdet. Is the automatically generated table from tedana the same as rica's? One thing we can try in the next days speaking with César is if we can use an extract of the data from EuskalIBUR for this purpose (like a half or a quarter of brain of a subject), if you can accept more data. |
The page executes again instead of showing static code. It builds its inputs from the tedana tutorial outputs (automatic classification), a gray matter ROI from the fMRIPrep segmentation, and a simulated CO2 recording, which stands in until a public dataset with a real recording is available. Pin numpy below 2.4, since peakdet 0.6.1 fails to find peaks with it, and remove three duplicated entries from references.bib, which stopped the parser before the entries that follow them.
Problem
content/06_Cerebrovascular_Reactivity_Mapping.mdcould not execute: every code cell referred to files that are not in the repository (../optcom.nii.gz,../co2.phys, a manual classification table, masks), and no CO2 recording ships with the tutorial data.Fix
The first version of this PR turned the code cells into static code blocks. Following the review comment, the page now executes instead, using files the book already produces:
Three
phys2cvrvariants run (CO2 recording with peak detection, pre-made PETCO2 trace, ROI-average signal). The task-design variant stays a static block, because the data contain no respiratory task.Other changes:
pyproject.toml: pinnumpy<2.4.peakdet0.6.1 (the latest release) fails inpeakfind_physiowith numpy 2.4.content/references.bib: remove three duplicated entries. They stopped the parser, so theCohen2025RScitation on this page did not resolve._config.yml: the page is no longer excluded from execution.Known limitations
lagged_regression=False. With a bulk shift of zero,phys2cvr(0.28.4, and current master) builds an empty set of lagged regressors and fails.Verification
The page executes in a local build and is in the published execution cache, so CI renders it from there. The rendered page shows the three figures, no tracebacks, and resolved citations.
🤖 Generated with Claude Code