nbdev icon indicating copy to clipboard operation
nbdev copied to clipboard

Skip All Cells Below a Flag Like #| notest_all_below

Open jakobhec opened this issue 9 months ago • 2 comments

In my notebooks, I typically follow a structure where the top portion contains reusable or exportable code, and the bottom portion serves as a playground area for quick experiments and testing.

To prevent nbdev_test from running these cells, I usually add something like #| notest at the top of each playground cell. This works, but it gets a bit cumbersome when the bottom of the notebook contains many such cells. Sometimes, I also forget to add that to a cell, and so testing fails. Then I need to figure out where I forgot to add that flag.

What I’d really like is the ability to set a single flag or marker in a cell—something like # | notest_all_below—that would instruct the tool to ignore all subsequent cells for testing (and/or export). This would make things much cleaner and reduce repetition.

Is there a feature like this already available? Or has anyone found a hacky workaround I could use for now?

jakobhec avatar Mar 23 '25 06:03 jakobhec

Hey @jakobhec, this feature does exist.

Image

deven367 avatar Mar 25 '25 14:03 deven367

Thank you! The documentation for this is here.

It is very similar, but I would like to skip all cells below a specific cell, and not all the cells in a notebook.

jakobhec avatar Mar 26 '25 10:03 jakobhec