emacs-jupyter / jupyter

An interface to communicate with Jupyter kernels.
GNU General Public License v3.0
946 stars 93 forks source link

[FR] Add a hook `jupyter-org-execution-finished` that triggers when all in-progress cells have finished #350

Open NightMachinery opened 3 years ago

NightMachinery commented 3 years ago

Scientific programming often entails waiting for expensive computation t be done. It would be great if there was a hook that was triggered when all in-progress cells finished. (I personally use async blocks, so this would be when all async blocks' results were realized.)

If the hook could also get an input argument that indicated the time the execution took, that would even better, but this feature doesn't matter much.

nnicandro commented 3 years ago

If you are saying you would like a hook that triggers when a cell has completed that is doable. The hook can be run in jupyter-handle-execute-reply in jupyter-org-client.el.

A text property can be added to the source block which gives the start time of the execution and that property can be read to get the execution time when the hook is run.