deshaw / jupyterlab-execute-time Goto Github PK
View Code? Open in Web Editor NEWA JupyterLab extension for displaying cell timings
License: BSD 3-Clause "New" or "Revised" License
A JupyterLab extension for displaying cell timings
License: BSD 3-Clause "New" or "Revised" License
Hey,
when enabling timing, the output from the plugin is the only cell output I get.
Is this an inteded behaviour?
Best regards
Nico
I got below message when checking extension status. It shows jupyterlab-execute-time v1.0.0 enabled ok, but also shows it is uninstalled. The result of this is that the execution time won't show. i have tried to uninstall jupyterlab and reinstall but didn't work. I'd appreciate any ideas how to fix this.
`(core) C:\Users\hahy>jupyter labextension list
JupyterLab v2.1.4
Known labextensions:
app dir: C:\Users\hahy\Miniconda3\envs\core\share\jupyter\lab
@jupyter-widgets/jupyterlab-manager v2.0.0 enabled ok
@jupyterlab/toc v4.0.0 enabled ok
jupyterlab-chart-editor v4.7.1 enabled ok
jupyterlab-execute-time v1.0.0 enabled ok
jupyterlab-plotly v4.7.1 enabled ok
Uninstalled core extensions:
jupyterlab-execute-time`
Hi,
When I installed this extension, I got an error of 'validation failed'. The log file gives the following error message.
A _jupyter_server_extension_points
function was not found in jupyterlab_execute_time.
According to the Jupiter server documentation, this function is required for an extension to be discoverable.
The version of JupyterLab I'm using is 3.6.1.
Can you resolve this issue?
Thanks!
hi, inistalled the extension via
jupyter labextension install jupyterlab-execute-time --debug
without an error.
when i launch jupyter lab, there is no error shown. Butt when i run any cell the output is showing without an error. But there is no execution time info being shown under the cell.
When I check advanced settings: I can see that:
{
// Execute Time
// jupyterlab-execute-time:settings
// [missing schema description]
// ********************************
// Enabled
// Enable ExecuteTime cell extension
"enabled": true,
// Highlight
// Highlight the execution time on completion
"highlight": true
}
jupyter labextension list
JupyterLab v2.1.0
Known labextensions:
app dir: d:\dmp\envs\py3\share\jupyter\lab
@jupyter-widgets/jupyterlab-manager v2.0.0 enabled ok
@jupyterlab/debugger v0.2.0 enabled ok
@jupyterlab/inspector v2.1.0 enabled ok
@krassowski/jupyterlab_go_to_definition v1.0.0 enabled ok
@lckr/jupyterlab_variableinspector v0.5.0 enabled ok
jupyterlab-execute-time v1.0.0 enabled ok
and also my pip freeze:
pip freeze
appdirs==1.4.3
attrs==19.3.0
backcall==0.1.0
black==19.10b0
bleach==3.1.4
certifi==2020.4.5.1
chardet==3.0.4
click==7.1.1
colorama==0.4.3
decorator==4.4.2
defusedxml==0.6.0
entrypoints==0.3
idna==2.9
importlib-metadata==1.6.0
ipykernel==5.1.4
ipython==7.13.0
ipython-genutils==0.2.0
ipywidgets==7.5.1
jedi==0.17.0
Jinja2==2.11.2
json5==0.9.4
jsonschema==3.2.0
jupyter-client==6.1.3
jupyter-core==4.6.3
jupyterlab==2.1.0
jupyterlab-code-formatter==1.2.4
jupyterlab-server==1.1.1
MarkupSafe==1.1.1
mistune==0.8.4
nbconvert==5.6.1
nbformat==5.0.6
notebook==6.0.3
numpy==1.18.2
packaging==20.3
pandas==1.0.3
pandocfilters==1.4.2
parso==0.7.0
pathspec==0.8.0
pickleshare==0.7.5
prometheus-client==0.7.1
prompt-toolkit==3.0.5
Pygments==2.6.1
pyparsing==2.4.7
pyrsistent==0.16.0
python-dateutil==2.8.1
pytz==2019.3
pywin32==227
pywinpty==0.5.7
pyzmq==19.0.0
regex==2020.4.4
requests==2.23.0
Send2Trash==1.5.0
six==1.14.0
terminado==0.8.3
testpath==0.4.4
toml==0.10.0
tornado==6.0.4
traitlets==4.3.3
typed-ast==1.4.1
urllib3==1.25.9
wcwidth==0.1.9
webencodings==0.5.1
widgetsnbextension==3.5.1
wincertstore==0.2
zipp==3.1.0
any help will be appreciated.
Hi is there a version for Jupyterlab < 3.0 available?
merci
Hi, I really like this extension, but I cannot see the times when converting to html. Is there any way to get it? We use html's extensively to share notebook reports, and it's a shame losing this piece of info.
I'm sure this is not just this extension but something bigger that I'm missing out
Currently only JupyterLab < 3.0.0 is supported:
Conflicting Dependencies:
JupyterLab Extension Package
>=3.0.7 <3.1.0 >=2.0.2 <3.0.0 @jupyterlab/application
>=3.0.7 <3.1.0 >=2.0.2 <3.0.0 @jupyterlab/notebook
>=3.0.3 <3.1.0 >=2.0.1 <3.0.0 @jupyterlab/settingregistry
See the log file for details: /tmp/jupyterlab-debug-cvq9ag4k.log
I want this type format:
2011-11-04 00:05:23.000 - 2011-11-04 00:05:23.014, executed in 14ms
jupyterlab/jupyterlab#13953 (comment)
Can we configure this in easy way? Or can be done this settings around in options Jupyter nbextensions as #nbextensions_configurator
?
Scrollbar should be the same size as when no timing is shown.
If this is not immediately reproducible I can try it in minimal environment/provide more detail.
The extension "jupyterlab-execute-time" does not yet support the current version of JupyterLab.
Conflicting Dependencies:
JupyterLab Extension Package
>=3.4.3 <3.5.0 >=2.0.2 <3.0.0 @jupyterlab/application
>=3.4.3 <3.5.0 >=2.0.2 <3.0.0 @jupyterlab/notebook
>=3.4.3 <3.5.0 >=2.0.1 <3.0.0 @jupyterlab/settingregistry
If you could update this extension when you get the time I would really appreciate, I would love to use it on my system!
When trying to install the extension on jupyterlab v.3.0.7 I get the following error:
An error occured.
ValueError: The extension "jupyterlab-execute-time" does not yet support the current version of JupyterLab.
Conflicting Dependencies:
JupyterLab Extension Package
=3.0.4 <3.1.0 >=2.0.2 <3.0.0 @jupyterlab/application
=3.0.4 <3.1.0 >=2.0.2 <3.0.0 @jupyterlab/notebook
=3.0.2 <3.1.0 >=2.0.1 <3.0.0 @jupyterlab/settingregistry
See the log file for details: /tmp/jupyterlab-debug-gwfadd40.log
@mlucool I've set up a conda-forge recipe for the newest version of this package here. I have two questions about this (and can't seem to ping you from over there, so here we are).
I added your name as a package maintainer. Please let me know if that's okay, and if there's anyone else who should go on there. (Also, since this is your package, I really won't be offended if you want my name taken off that list for some reason.)
Conda-forge requires some tests. I don't know how this works for things like jupyterlab, so I just copied the tests from the jupyterlab recipe. Please let me know if there's anything that should be removed or added.
Hi Guys,
the extension is not working for me :(
I already tried to reinstall it, but it didn't help.
Jupyter lab version: 2.2.9
conda env of jupyter lab:
Kernel of environment that is selected in jupyter lab notebook:
jupyter labextension list
looks like this:
The problem seems to be that my cells don't produce any metadata. If I run a cell with nothing inside but print("Hello World")
I end up with his:
Any suggestions what I could try?
Hello,
I'm having issues getting this extension to work. I've tried my best to follow the instructions in the README using pip install jupyterlab_execute_time
and making sure that I to enable cell timing in the notebook via Settings->Advanced Settings Editor->Notebook: {"recordTiming": true}
.
The software versions that I'm using are
$ jupyter --version
jupyter core : 4.7.1
jupyter-notebook : 6.3.0
qtconsole : 5.0.3
ipython : 7.22.0
ipykernel : 5.5.3
jupyter client : 6.1.12
jupyter lab : 3.0.14
nbconvert : 6.0.7
ipywidgets : 7.6.3
nbformat : 5.1.3
traitlets : 5.0.5
jupyterlab-execute-time : 2.0.2
I don't know if this is an issue with the M1 Apple Silicon. I'm running macOS 11.3 and I installed Python 3.9.4
with brew
.
The metadata is being recorded correctly, because the time stamps and wall times show up correctly when I open the notebook on a different machine that also uses juypterlab-execute-time
. So it is not like this issue. It's a new installation of JupyterLab v3.0.14
, so I don't think I have any holdover issues like this one. I tried running jupyter labextension enable jupyterlab-execute-time
, but nothing changed, and when I list the extensions I'm using it doesn't return anything.
$ jupyter labextension list
JupyterLab v3.0.14
I know there are a lot of issues and stackoverflow questions that have been opened involving the time not showing. This is the only extension that I use and I really appreciate the work that's been put into it. I'd be grateful for any help or insight. Let me know what kind of details you may need.
Thank you
Hi there!
I've noticed that the execution times are stacking up:
This is likely due to a conflict with the Collapsible Headings extension. When the sections are collapsed, the timings stack up. Although I'm not particularly clear on the exact way in which the timings are stacking up.
When I run a call manually, with the cell open (not collapsed), it clears 2 of the timings and adds 1 more. Currently, the only way I can find to clear them is to manually run each cell many times, clearing 1 timing at a time.
System Information:
Let me know if you need any more information.
Lloyd
Would be great to add support for Jupyter Lab 3.1.x ?
https://github.com/deshaw/jupyterlab-execute-time/blob/master/package.json#L59-L64
https://jupyterlab.readthedocs.io/en/stable/getting_started/changelog.html#v3-1
Thanks!
Would be nice to have option to display actual running time of a cell execution. So it ticks say once per second, displaying how long the cell is running
I understand that I can "calculate" running time by looking at the current clock and the "Execution started at" value but it is not exactly convenient.
just as my title of the issue
After the extension is installed, there is nothing but my outcome below my cell, though I have restarted jupyterlab.
While investigating elyra-ai/elyra#2387 I've found that notebooks executed via papermill (which derives from nbclient) doesn't record shell.execute_reply.started
in the cell's execution metadata. I'm assuming this is because shell.execute_reply.started
is not in the notebook format spec. This results in incorrect duration results since shell.execute_reply.started
does exist albeit relative to the last time the notebook was executed via Lab.
Since an execute_input
response is essentially when the cell's execution is started (using ipykernel as an example), I'm hoping we could drop the use of shell.execute_reply.started
and replace the cell's start calculation with the fallback code already in place.
Would that be a change the project would be willing to accept?
Also, since execute_input
may not be available (e.g., if silent
is enabled, again in ipykernel), should the in
clause be discarded if the duration cannot be determined?
nbclient also uses local timestamps for each of the timing entries, but that's a different issue.
I installed jupyterlab-execute-time
via pip successfully:
~ % pip3 list | grep jupyter
jupyter-client 7.3.4
jupyter-core 4.10.0
jupyter-server 1.17.1
jupyterlab 3.4.3
jupyterlab-execute-time 2.1.0
jupyterlab-pygments 0.2.2
jupyterlab-server 2.14.0
However timing information does not appear under the cells:
recordTiming
is set to true
in the settings and timing does appear in the cell metadata, like
{
"tags": [],
"execution": {
"iopub.status.busy": "2022-06-18T05:14:53.304459Z",
"iopub.execute_input": "2022-06-18T05:14:53.306176Z",
"iopub.status.idle": "2022-06-18T05:14:53.321343Z",
"shell.execute_reply.started": "2022-06-18T05:14:53.305443Z",
"shell.execute_reply": "2022-06-18T05:14:53.320273Z"
}
}
No sure if this is jupyterhub specific or a general issue. But if the jupyter-kernel dies for any reason the time ticker keeps going and the cell looks like it is still running. The asterisk at the side of the cell also still shows the cell as running. Has anyone else experienced this?
Reproduce:
1 create a notebook with more than 20 code cells in it and run it, all the execute time records for all code cells will be shown .
2 Then save and reopen the notebook, scroll down, there were several code cells with no execute time records shown in the tail part of the notebook
3 It occurs in both Python notebook and R notebook.
Envs:
win 10/2019, a fresh installation with the following code:
conda create -n jupyterpy38demo python=3.8
pip install jupyterlab==3.2.8 jupyterlab-execute-time pandas
conda install -c r r-essentials (R 3.6.1)
Expectation:
Like it behaves in Jupyterlab 2.2.9, all the execute time records are shown normally.
As of [email protected] we are seeing the following codemirror bug when line numbers are enabled:
This is true with [email protected] as well as at least the 3.4.8. To reproduce simply open two notebooks. Opening the second notebook makes a scroll bar appear in all cells in the first notebook, which shifts the text left. Clicking on any cell fixes it. I am not able to reproduce this with earlier versions of this extension.
The package for jupyterlab_execute_time located at C:\Users\smsma\miniconda3\pkgs\jupyterlab_execute_time-2.3.1-pyhd8ed1ab_0
appears to be corrupted. The path 'site-packages/jupyterlab_execute_time/labextension/static/vendors-node_modules_css-loader_dist_runtime_api_js-node_modules_css-loader_dist_runtime_cs'
specified in the package manifest cannot be found.
CondaVerificationError: The package for jupyterlab_execute_time located at C:\Users\smsma\miniconda3\pkgs\jupyterlab_execute_time-2.3.1-pyhd8ed1ab_0
appears to be corrupted. The path 'share/jupyter/labextensions/jupyterlab-execute-time/static/vendors-node_modules_css-loader_dist_runtime_api_js-node_modules_css-loader_dist_runtime_c'
specified in the package manifest cannot be found.
active environment : autogpt_DA active env location : C:\Users\smsma\miniconda3\envs\autogpt_DA shell level : 2 user config file : C:\Users\smsma\.condarc populated config files : C:\Users\smsma\.condarc conda version : 23.3.1 conda-build version : not installed python version : 3.10.9.final.0 virtual packages : __archspec=1=x86_64 __cuda=12.1=0 __win=0=0 base environment : C:\Users\smsma\miniconda3 (writable) conda av data dir : C:\Users\smsma\miniconda3\etc\conda conda av metadata url : None channel URLs : https://conda.anaconda.org/conda-forge/win-64 https://conda.anaconda.org/conda-forge/noarch https://repo.anaconda.com/pkgs/main/win-64 https://repo.anaconda.com/pkgs/main/noarch https://repo.anaconda.com/pkgs/r/win-64 https://repo.anaconda.com/pkgs/r/noarch https://repo.anaconda.com/pkgs/msys2/win-64 https://repo.anaconda.com/pkgs/msys2/noarch package cache : C:\Users\smsma\miniconda3\pkgs C:\Users\smsma\.conda\pkgs C:\Users\smsma\AppData\Local\conda\conda\pkgs envs directories : C:\Users\smsma\miniconda3\envs C:\Users\smsma\.conda\envs C:\Users\smsma\AppData\Local\conda\conda\envs platform : win-64 user-agent : conda/23.3.1 requests/2.29.0 CPython/3.10.9 Windows/10 Windows/10.0.22000 administrator : False netrc file : None offline mode : False
Hi,
it would be very useful to see duration of previous run.
Reason why this is useful:
We all have notebooks, where some cells are taking quite a long time and here is the situation:
So here is the complete idea for implementation:
Last executed at 2022-10-01 13:48:57 in 43.54s
Previous run: 2m 43s | Execution started at 2022-10-01 14:06:00
Previous run: 2m 43s | Last executed at 2022-10-01 13:48:57 in 43.54s
The old information of previous run is on the left - to intuitively show it is old info from history.
The information about current run is on the right = the last information - to intuitively show, it is the latest new info.
**Very simple logic without any complexity: **
It is useful and practical for many common scenarios
Env: Just a fresh install of jupyterlab=3.2.4 and python=3.8.12 with conda, on windows 10
Detail: Just some code as the following picture,
1 run the code in the second cell for several times, the execute time record will change.
2 then by clicking Ctrl+Z on windows 10, the execute time record will go backward to last record(s) , not only the code, as it showed in the second picture.
Expect:
by clicking Ctrl+Z, only the code will go backward to its last result(s), the execute time record keeps as it is now. Just as it behaves in Jupyterlab 2.2.9 .
Note:
I have not tested it on Linux ,and if the execute time record will go forward by clicking short keys.
The extension "jupyterlab-execute-time" does not yet support the current version of JupyterLab.
Conflicting Dependencies:
JupyterLab Extension Package
>=3.1.12 <3.2.0 >=2.0.2 <3.0.0 @jupyterlab/application
>=3.1.12 <3.2.0 >=2.0.2 <3.0.0 @jupyterlab/notebook
>=3.1.12 <3.2.0 >=2.0.1 <3.0.0 @jupyterlab/settingregistry
Sometimes I want to narrow down which cells took long to execute. Scrolling the notebook to read time diffs in footers of cells is time consuming. I would love to have an opt-in visual indicator to aid such search, or another way to list cells that took longest to execute in any given notebook. Some ideas include:
Whether to use percentiles or absolute cutoffs could be customisable in settings.
Would anyone else find this helpful? Are any of those in scope for this extension?
I've installed the widget as described also here but when I enable it, the output of the cell is no longer displayed.
jupyterlab version: 2.1.5
IRkernel version: 1.1.1
Anaconda version: Anaconda3-2020.07-Linux-x86_64
R version: R version 4.0.2 (2020-06-22) -- "Taking Off Again"
Python version: 3.8.3
Node.js version: 14.13.0
Browser: Firefox 81.0 (64-bit)
Output when using python3 kernel within jupyterlab
Output when using R kernel within jupyterlab
As can be seen from the above image, the extension only shows the datetime stamp when using R kernel but the execution duration is missing. Works fine for python kernel though.
Please close this issue in case this is by design and the extension is not supposed to support R kernel at this stage (or for that matter any other kernel other than Python) - could not find anything on google hence opened the issue here.
Thanks
Edit: added text for clarity.
hello! this is an awesome extension and i would like to request/add a new feature:
basically, you get to see the previous execution details along with the current one.
this is useful for me because i would like to see the previous execution time so that i know roughly when the new runs will end.
if this is a good idea, ill try to implement it and make a PR.
lmkwyt 😁
Hi,
As a visually-compact alternative to showing timings underneath cells, would it be possible to render a tooltip of the timing information (possibly with some option to copy to clipboard) when hovering over a part of the cell (like the In[\d]
Out[\d]
bar on the left)?
-- Eric
Hi,
I would like to be able to have previous execution time to be displayed while a given cell is running. Let me know if you think it is possible to do that!
Currently, when a cell is executed:
What I would like to have:
It often happens that for cells that take a long time to execute, I wonder how long it will take before it is over (e.g. 10 minutes or 2 hours).
It would be nice to have that information for the previous cell execution to be displayed. You will not have that information if you run the cell before looking at the last execution time.
It seems like Jupyterlab 3.0.0 broke compatibility for a lot of extensions.
From the changelog :
For existing extensions, there is a new
python -m jupyterlab.upgrade_extension
script that can be used to upgrade extensions.
I know maybe this should go to jupytext rather than here, but just asking if there's any way to avoid this to happen?
I'm getting stuff like
# %% execution={"iopub.status.busy": "2020-10-12T14:04:28.606426Z", "iopub.execute_input": "2020-10-12T14:04:28.606732Z", "iopub.status.idle": "2020-10-12T14:04:28.610404Z", "shell.execute_reply.started": "2020-10-12T14:04:28.606703Z", "shell.execute_reply": "2020-10-12T14:04:28.609343Z"}
import pandas
# %% execution={"iopub.status.busy": "2020-10-12T14:04:29.902223Z", "iopub.execute_input": "2020-10-12T14:04:29.902537Z", "iopub.status.idle": "2020-10-12T14:04:29.906057Z", "shell.execute_reply.started": "2020-10-12T14:04:29.902510Z", "shell.execute_reply": "2020-10-12T14:04:29.905227Z"}
print(pandas.__path__)
in the original py file, when running the notebook and sync with py file. I wonder if there's any way to keep the py free of this info (as that's the one I'm pushing to git)
The original Execute Time from jupyter_contrib_nbextensions
had a few configuration options that let the user change things such as the status message wording or the date format to use.
It would be nice to add a way to configure things like these here too.
I am running jupyterlab version 3.0.14 and I am receiving the following error during installation:
Extension Installation Error
An error occurred installing jupyterlab-execute-time
.
Error message:
The extension "jupyterlab-execute-time" does not yet support the current version of JupyterLab.
Conflicting Dependencies:
JupyterLab Extension Package
=3.0.9 <3.1.0 >=2.0.2 <3.0.0 @jupyterlab/application
=3.0.9 <3.1.0 >=2.0.2 <3.0.0 @jupyterlab/notebook
=3.0.5 <3.1.0 >=2.0.1 <3.0.0 @jupyterlab/settingregistry
I am completely new in python.
I have installed the extention via pip as well as conda. But the execution time is not displayed.
There is a tab "Execute Time" under Advance Settings and it is also activated, but I don't get any information about the execution time if i run a cell.
I am using juypterLab version 3.5.3.
I can't find the place where to enter {"recordTiming": true}.
For me it looks like this under setting:
The extension "jupyterlab-execute-time" does not yet support the current version of JupyterLab.
Conflicting Dependencies:
JupyterLab Extension Package
=3.3.2 <3.4.0 >=2.0.2 <3.0.0 @jupyterlab/application
=3.3.2 <3.4.0 >=2.0.2 <3.0.0 @jupyterlab/notebook
=3.3.2 <3.4.0 >=2.0.1 <3.0.0 @jupyterlab/settingregistry
PS C:\Users\11567> jupyter --version
Selected Jupyter core packages...
IPython : 8.10.0
ipykernel : 6.21.2
ipywidgets : not installed
jupyter_client : 8.0.3
jupyter_core : 5.2.0
jupyter_server : 2.6.0
jupyterlab : 3.6.4
nbclient : 0.8.0
nbconvert : 7.4.0
nbformat : 5.9.0
notebook : 6.5.4
qtconsole : not installed
traitlets : 5.9.0
I've added:
{"recordTiming": true}
Of course I enabled extensions and installed, rebuilt, etc. I'm looking both in labs and in notebook. What is going wrong?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.