AnswerDotAI / AnswerDotAI/nbdev

Skip All Cells Below a Flag Like #| notest_all_below

Open
#1,511 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Jupyter Notebook
Stars
5.3k
Forks
513
Avg merge
2d 30m
Merged PRs (30d)
8

Description

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?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.