Repository navigation
Conversation
A line starting with ":::" (the pages' MyST admonitions) makes jupytext read a .md file as pandoc markdown, and pandoc only turns explicitly marked cells into code cells. The page therefore converts to a single markdown cell, and executing it passes without running anything. Add a has-code-cells test for the event-generation page so this is reported instead of hidden. Other pages are left unchanged for now. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UKgjg6FJ4R6Jbp3pdhqVQD
ianna
force-pushed
the
ci-notebook-code-guard
branch
from
October 8, 2026 14:26
ddc5539 to
6c7464d
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds one test,
2-gen-and-fastsim/2-1-event-generation/README-has-code-cells. It fails if the notebook jupytext produces from the event-generation page contains no code cells (.github/scripts/check_notebook_has_code.py). The other notebook tests are unchanged.Why
Running a notebook with no code cells always succeeds. With CI's own versions, jupytext 1.16.0 (the stack's) and pandoc 3.10 (installed by
test.yml), the event-generation page converts to a single markdown cell and zero code cells::::(the MyST admonitions) makes jupytext guess that the.mdfile is pandoc markdown;The page's notebook test therefore passes without running anything.
Minimal reproduction: the yaml header plus a
pythonand abashfence gives 2 code cells; add one:::{admonition}block and you get 0.Expected result
This PR is expected to turn the new test red until the conversion is fixed. Reproduced on LXPLUS with the stack's jupytext 1.16.0 and pandoc 3.10:
The other five pages convert the same way. This PR deliberately covers only the generator page.
add_nb_code_guard()can be applied to further pages later.Not in this PR
How to fix the conversion is a separate decision. Removing the
:::lines (or forcing--from md) brings the code cells back, but then every fence on the page runs as a separate%%bashcell:cdand variables don't carry over between cells, and full-size jobs (10,000-event generation, Whizard, KKMCee) would run too. For this page, #211 instead runs tagged fragments.🤖 Generated with [Claude Code](https://claude.com/claude-code)