Replace "Run all" button with "Restart and run all" button #9217
Locked
benlindsay
started this conversation in
New Ideas
Replies: 2 comments
-
This is a good suggestion, I agree this button in Jupyter Lab & Notebook restarts and runs all the cells. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Agreed. Made an issue to track this suggestion. See #9242 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In the Jupyter toolbar, there's a Run All button
which looks a lot like the Restart and Run All button in Jupyter Lab
My initial expectation was that those buttons would be analogous, but in VSCode, it does not restart the kernel or clear outputs. Having that button fail to clear outputs is harmful because state from the previous run can be reused. For example, say you have a notebook with 2 cells:
and
If you run just the second cell, then click "Run All", your notebook will not fail even though it should. I can't think of any reason someone should want to rerun a notebook without also restarting the kernel. As for the clearing outputs bit, there is a case to be made for not clearing outputs, because it can be nice to see what was previously there. However, 2 points in favor of clearing outputs are 1) it would match behavior expectations from Jupyter Lab, and 2) when outputs are cleared prior to rerunning, it's much easier to tell where a failure occurred when scrolling through the notebook. Harder to tell when old outputs remain.
I hacked together a solution by adding a multicommand keybinding to keybindings.json, but that really shouldn't be necessary for a critical functionality. My keybinding looks like this:
Thanks for all of y'all's work on this project!
Beta Was this translation helpful? Give feedback.
All reactions