Skip to content

Fix Cerebrovascular Reactivity Mapping (ch06) build: make it illustrative#87

Open
eurunuela wants to merge 2 commits into
ME-ICA:mainfrom
eurunuela:fix-cvr-ch06-build
Open

Fix Cerebrovascular Reactivity Mapping (ch06) build: make it illustrative#87
eurunuela wants to merge 2 commits into
ME-ICA:mainfrom
eurunuela:fix-cvr-ch06-build

Conversation

@eurunuela

Copy link
Copy Markdown
Contributor

Problem

content/06_Cerebrovascular_Reactivity_Mapping.md fails the Jupyter Book build with FileNotFoundError: ../manual_classification.tsv. That error is only the first of several — Jupyter Book stops executing a notebook at its first failure, so the rest stay hidden. In fact every {code-cell} in the chapter references files that aren't in the repo (../optcom.nii.gz, ../co2.phys, the brain/ROI masks, the ICA mixing matrix), plus a stray raise ValueError("SKIP"), and no CO₂/physio data ships with the book. The chapter can therefore never execute during a build.

Fix

Convert the chapter's 9 {code-cell} ipython3 blocks to plain ```python blocks, matching content/08_ICA_Based_Denoising.md — the analogous illustrative tutorial that the book already ships. The page now renders as a guide the reader runs on their own data, and the raise ValueError("SKIP") hack is dropped. Markdown-only change (+9 / −10).

Verification

The book builds and 06_Cerebrovascular_Reactivity_Mapping.err.log is gone from _build/html/reports/content/ (chapter 06 previously halted there).

Out of scope

Pre-existing, non-blocking warnings remain on the page and are left untouched: a broken cross-reference to the rica 07 page and a missing bibtex key Cohen2025RS.

🤖 Generated with Claude Code

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>
Copilot AI review requested due to automatic review settings June 9, 2026 11:07

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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} ipython3 blocks with plain fenced ```python blocks 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 to accepted_ic_timeseries.csv and 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>
@eurunuela

Copy link
Copy Markdown
Contributor Author

Addressed the Copilot review feedback on the first code block (909b752):

  • Typo fixed — the example saved to accecpted_ic_timeseries.csv but the later phys2cvr calls read accepted_ic_timeseries.csv, so a reader following the tutorial would hit FileNotFoundError. Corrected the spelling so the saved and consumed filenames match.
  • Indentation — indented the block so it renders inside the bullet list item that introduces it (it was at column 0). Verified it parses as a fenced python block nested in the list item.

Both were pre-existing in the chapter; folded them in here since the reviewer flagged them on the block this PR touches.

@eurunuela eurunuela requested a review from tsalo June 9, 2026 13:08
@eurunuela

Copy link
Copy Markdown
Contributor Author

This may be a me issue @tsalo @smoia . Feel free to close it if you can't reproduce the issue.

@smoia

smoia commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

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?

@tsalo

tsalo commented Jun 9, 2026

Copy link
Copy Markdown
Member

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).

@eurunuela

Copy link
Copy Markdown
Contributor Author

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.

@smoia

smoia commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

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.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants