jupyter / notebook

Jupyter Interactive Notebook
https://jupyter-notebook.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
11.59k stars 4.86k forks source link

Queue management for running cells. #7205

Open rumbleFTW opened 8 months ago

rumbleFTW commented 8 months ago

Problem

There is a current limitation in Ipykernel where it is not possible to modify the order or cancel operations of queued cells once they have been set. This limitation can disrupt a smooth workflow and may result in the loss of variables, a dead kernel, or other issues if not managed carefully.

Proposed Solution

To address this issue, I suggest implementing a feature that allows dynamic modification of queued cells while a cell is running or a queue is active. This can be achieved through two possible approaches:

  1. Introduce a separate section where the queue is displayed, providing options to move or delete items from the queue.

  2. Display the queued items along with their order within the cell body itself, allowing users to edit the order directly.

Additional context

Implementing such a feature would greatly benefit users, preventing the loss of valuable time caused by inadvertently queuing the wrong cell. And I can take up the responsibility to ship out this feature once approved. Thanks!

RRosio commented 8 months ago

Pinging @krassowski here for more comments following the Triage meeting.

krassowski commented 8 months ago

This was previously discussed in https://github.com/jupyter/notebook/issues/2340, and is currently tracked in https://github.com/jupyterlab/jupyterlab/issues/7825. The frontend implementation would likely first happen on jupyterlab level (with or without changes to Jupyter kernel protocol - depending on how we want to manage a queue) and then be inherited by Jupyter Notebook which reuses JupyterLab components. This topic gets even bigger when we consider async execution of cells, which changes the execution model from linear to DAG. Feel welcome to experiment with implementation approaches or ask more detailed questions, but lets keep the discussion in https://github.com/jupyterlab/jupyterlab/issues/7825 to avoid splitting the discussion.

I hope I can come back with more details later in the month, feel free to ping me if you do not hear back from me in a few weeks.