Automatic cell execution timing in jupyter lab

℡╲_俬逩灬. 提交于 2020-05-25 07:15:25

问题


In jupyter notebook, I can configure an automatic cell timing with nbextensions, the result is like so:

jupyter_notebook

How can i do this in jupyter lab? I didn't found any extensions that did a similar thing.

Obs.: I know that a similar result can be achieved with %%time magic, but i want it to be automatic, so I don't have to place the magic function at the begining of each cell


回答1:


Requirement

JupyterLab >= 2.0.2

Let's move step by step

Extension availabel in jupyter lab is

jupyterlab-execute-time

first enable extension Manager

after enable you see new button in side task bar at the end "extension Manager"

You can also enable it with the following steps:

  1. Go into advanced settings editor.
  2. Open the Extension Manager section.
  3. Add the entry “enabled”: true.
  4. Save the settings. If prompted whether you are sure, read the warning, and click “Enable” if you are still sure. Once enabled, you should see a new tab appear in the left sidebar

By default, the disclaimer is not acknowledged.

As the disclaimer is not acknowledged, you can search for an extension, but can not install it (no install button is available).

To install an extensino, you first have to explicitly acknowledge the disclaimer. Once done, this will remain across sessions and the user does not have to check it again.

Finding Extension

search jupyterlab-execute-time

Install Enable

After enable you have to Rebuild it: A small popup window open on it click on Rebulid;

then you have to restart kernel

Still you find you will not able to see what you want :

Last thing

Note: for this to show anything, you need to enable cell timing in the notebook via Settings->Advanced Settings Editor->Notebook: {"recordTiming": true}

advance setting editor

finally "recordTiming"=true

and save it at right end!



来源:https://stackoverflow.com/questions/56843745/automatic-cell-execution-timing-in-jupyter-lab

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!