emacs-jupyter/jupyter

Feature request: Display running status of `ob-jupyter`

Open

#146 opened on Jul 12, 2019

 (6 comments) (0 reactions) (0 assignees)Emacs Lisp (106 forks)auto 404
enhancementhelp wanted

Repository metrics

Stars
 (1,028 stars)
PR merge metrics
 (No merged PRs in 30d)

Description

When using ob-jupyter with :async, I find that quite often I get lost when I eval all blocks or blocks before point. When waiting for the async results, I usually do some other editing. But it's hard for me to check which block is running or whether it has finished.

I tried to use hooks like org-babel-after-execute-hook to start and stop a spinner to indicate the evaluation progress. But it failed in the :async mode.

I also tried to use a counter to advice jupyter-generate-request or jupyter-handle-execute-reply since I found that a reliable way to check whether a block has finished is in jupyter-handle-execute-reply as I noticed the message "Code block evaluation complete." was from there.

(cl-defmethod jupyter-handle-execute-reply :before ((_client jupyter-org-client)
                                                        (req jupyter-org-request)
                                                        status
                                                        _execution-count
                                                        _user-expressions
                                                        payload)
      (decf jupyter-org-bable-request-count)
      (if (= jupyter-org-bable-request-count 0)
          (jupyter-org-bable-reset-request-count)))

But it failed. jupyter-generate-request seems not the right place to start the counter. And I know very little about cl things or concepts (like cl-defmethod).

It will be really nice to have functions to

  • go to current running block
  • show running status in modeline
  • display the number of pending requests and the total requests [3/11] of last evaluation request (like org-babel-execute-buffer, jupyter-org-execute-to-point) in modeline or somewhere
  • stop all pending requests (jupyter-repl-interrupt-kernel seems only stop the current running one)

How do you think about it?


By the way, thanks for the great package. I've been tried to get into org-babel in the last eight years. But failed even after I tried org-babel itself, ein, and ob-ipython and scimax, many times. I try emacs-jupyter started from this week and it is super robust and the experience is really great!

Contributor guide