[all-commits] [llvm/llvm-project] fbec83: [llvm][TableGen][Jupyter] Add configurable default...
David Spickett via All-commits
all-commits at lists.llvm.org
Fri Aug 4 03:16:58 PDT 2023
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: fbec83cbe3ffcb53586f365651c6e208be3d1880
https://github.com/llvm/llvm-project/commit/fbec83cbe3ffcb53586f365651c6e208be3d1880
Author: David Spickett <david.spickett at linaro.org>
Date: 2023-08-04 (Fri, 04 Aug 2023)
Changed paths:
M llvm/utils/TableGen/jupyter/LLVM_TableGen.ipynb
M llvm/utils/TableGen/jupyter/LLVM_TableGen.md
M llvm/utils/TableGen/jupyter/tablegen_kernel/kernel.py
Log Message:
-----------
[llvm][TableGen][Jupyter] Add configurable default reset behaviour
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.
Reviewed By: awarzynski
Differential Revision: https://reviews.llvm.org/D149055
More information about the All-commits
mailing list