-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Notebook cell execution #169
Comments
Taking the following scenario with the above proposal:
So for me a state information should not be part of the document.
|
After reading twice @fcollonval scenario, I tend to agree that the state information should not be part of the document. This drives I think to a more general discussion about "what is a document?, what is a notebook?, what is a kernel?, what is a server? what is a state?" in RTC land. |
No, it means I was not finished when the notebook was saved, and it's aligned with the cell outputs. For instance, imagine a cell that prints intermediary results and a final result. The saved notebook won't show the final result, which is reflected in the execution state as not finished.
It is already, implicitly through the outputs. IMO the execution state just makes it more explicit. |
This is a developer perspective. How can user eyes go from
You are taking for granted that the current implementation (the outputs are part of the CRDT) is the right approach, which I am not convinced. |
Let me reformulate to just not finished executing, which is the current situation.
No, I am just taking for granted that outputs are part of the notebook format, CRDT or not. |
No the current situation is more specific than that; we displayed a
So there are always an assumption it is a transient information linked to some live interaction with the kernel. You are raising a good point about the outputs that could be reflecting only a partial execution. So I lean towards proposing adding an information in the document about a cell being partly executed that should be unrelated to the |
Although execution being queued is really kernel specific. For instance, akernel has the ability to run cells concurrently, so they might never be queued. If cells are queued, it's only because the kernel is executing blocking code. |
I stil think that
You clearly define two different states, but foresee only one indicator for the user. This could be better, like eg..
However, the static representation of the notebook in a ipynb file with nbformat should not be discussed at the same level as the runtime status of that same notebook. Hence my point above that the rules and schemas should be different. |
I would even be tempted to say that the output of a cell not being fully executed should not be part of that saved version (the ipynb file) of the notebook, as showing incomplete and potentially giving wrong conclusions to the reader. I don't expect everyone to agree with that, but I expect this to be a discussion point. |
My point is that there are not two different states, only one which is scheduled for execution. The |
I opened #197 which adds an |
As a counter proposal, #227 adds |
Thx a lot @krassowski for joining the bits. I sometimes tend to step a it too much back, but I can see separated tracks like |
To recap, we have three proposals:
Separately, there is a question of recording execution timing data on the server side (for use cases of |
Thx, useful for the pending_request story. There are other aspects that are not tackled like:
These are just 2 examples, I am pretty sure there are other ones that will be discovered as side effects if we don't carefully identify them. |
I think there should be two different states even in an async kernel, because there is a use case for executing async cells with dependencies and cancelling a cell which was scheduled to run while its dependencies have not finished. In fact the execution queue visualisation and manipulation is one of the most frequently requested features in JupyterLab issue tracker: jupyterlab/jupyterlab#7825. I believe we should design the API with this in mind. |
In the future maybe should be a fourth state to indicates that the kernel died when the cells were executing (or waiting in execution queue), say |
Also, pending user input is a special case of running. |
Coming here from a difference place today: I am trying to implement an indicator that a cell is running in the minimap for notebook; the minimap has access to cell models but not widgets. The problem is the To move forward with implementation I want to deprecate Thinking out loud, both Further, I would think that I think the logic for prompt would be, in pseudo code: if execution_state == 'idle':
if execution_number:
prompt = '[' + execution_number + ']'
else:
prompt = '[ ]'
elif execution_state == 'queued':
prompt = '[.]'
elif execution_state == 'running':
prompt = '[*]' This is also loosely related to datalayer/jupyter-server-nbmodel#13 |
Problem
Today at the Jupyter Server meeting we talked about notebook restoration, where RTC could be a solution (see jupyter-server/jupyter_server#900). In that solution, the frontend just displays live changes to the notebook shared model. But currently, a notebook cell execution is either
None
or an integer greater than 0, so there is no way to show that a cell is executing.Proposed Solution
We could encode the "cell executing" state in the execution count, for instance as
"*"
. I think it could even be part of nbformat, because it brings some information about the state of the notebook at the time it was saved.The text was updated successfully, but these errors were encountered: