question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Tag to skip cell execution

See original GitHub issue

Is your feature request related to a problem? Please describe.

There are some cells I’d like run during development, but not during the book build step. The example I’m working with now are magic calls.

Describe the solution you’d like I would like a tag that I can add to a cell, not to only hide the cell input/output (as here–it appears that even remove-cell still executes the contents), but a tag that ensure the entire code cell isn’t run during build.

Describe alternatives you’ve considered I’ve tried commenting the cells out when I’m doing making interactive changes, and uncommenting them if I have to do some interactive work.

Additional context n/a

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:15
  • Comments:30 (21 by maintainers)

github_iconTop GitHub Comments

5reactions
chrisjsewellcommented, Sep 23, 2021

FYI on this, https://github.com/jupyter/nbclient/pull/151 is now merged, so once a new version of nblient is out, you will be able to use the skip-execution tag 😄

2reactions
chrisjsewellcommented, Dec 6, 2021

This is now available from nbcient>=0.5.5 (https://github.com/jupyter/nbclient/compare/0.5.4...0.5.5) I believe this is installable with latest jupyter-book (it should be only jupyter-cache pinning nbclient: https://github.com/executablebooks/jupyter-cache/blob/7917c680f97af055ac60fca345822d092f1d3d6e/setup.cfg#L32) So closing this issue then should just be a matter of adding some documentation on it (around here: https://jupyterbook.org/content/execute.html#dealing-with-code-that-raises-errors, and also mirrored here: https://myst-nb.readthedocs.io/en/latest/use/execute.html#raise-errors-in-code-cells)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Is there a cell tag convention to *skip* execution? - Notebook
There is a pending feature to add the ability to skip certain cells based on tag for papermill, in which the offending cells...
Read more >
How to (intermittently) skip certain cells when running IPython ...
As a work-around, put %%cache folder/unique_identifier to the beginning of the cell. The code will be executed only once and no variables will ......
Read more >
Removing cells, inputs, or outputs - nbconvert
The most straightforward way to control which pieces of cells are removed is to use cell tags. These are single-string snippets of metadata...
Read more >
Skip cells when running Jupyter Notebook scripts
The simple solution is to place the cursor into the cell that you want to silence, then press Esc + r . The...
Read more >
Essential notebook commands - ArcGIS Enterprise
The Tags option can be used when you are preparing a notebook to be scheduled or remotely executed. This provides the option to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found