[PATCH] D149055: [llvm][TableGen][Jupyter] Add configurable default reset behaviour

David Spickett via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 24 04:41:58 PDT 2023


DavidSpickett created this revision.
Herald added a project: All.
DavidSpickett requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Often you are doing one of 2 things:

- Building a larger example from many small cells.
- Showing many small isolated examples.

The default so far has followed iPython, where cells are connected
by default (in its case, the interpreter state backing them sticks
around).

This change adds a new magic `%config` where you can change the setting
`cellreset` to change that behaviour (this is currently the only setting).

Also added is a `%noreset` magic so that along with `%reset` you can
override the default for one particular cell.

The default is equivalent to `%config cellreset off`. If you then
wanted to reset in a cell, you can just do %reset to override it.

(this is what the current notebooks do)

If you instead do `%config cellreset on`, cells always reset and
you can choose not to using `%noreset`.

The setting is named `cellreset` not `reset` to differentiate it
a bit more from the one off command `reset`.

The demo notebook has been updated with examples of this in action.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D149055

Files:
  llvm/utils/TableGen/jupyter/LLVM_TableGen.ipynb
  llvm/utils/TableGen/jupyter/LLVM_TableGen.md
  llvm/utils/TableGen/jupyter/tablegen_kernel/kernel.py

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D149055.516355.patch
Type: text/x-patch
Size: 13957 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230424/e61600b3/attachment-0001.bin>


More information about the llvm-commits mailing list