跳转到主要内容

在Jupyter Lab中显示单元时间

项目描述

jupyterlab-execute-time

PyPI version PyPI DM Github Actions Status Binder

在Jupyter Lab中显示单元时间

Execute Time Screenshot

这是由这里的notebook版本启发。

需求

  • JupyterLab >= 3.0

安装

使用pip安装此包,运行

pip install jupyterlab_execute_time

使用conda安装此包,运行

conda install -c conda-forge jupyterlab_execute_time

注意:默认情况下,如果启用此扩展,在加载时它会自动将您的设置更改为在笔记本元数据中记录时间。如果失败,您可以通过设置->高级设置编辑器->笔记本:{"recordTiming": true}手动进行此操作。这是一个笔记本元数据设置,而不是插件设置。插件只是显示这些数据。

贡献

开发安装

注意:您需要NodeJS来构建扩展包。

jlpm命令是JupyterLab的固定版本yarn,它是与JupyterLab一起安装的。您可以使用下面的yarnnpm代替jlpm

# Clone the repo to your local environment
# Change directory to the jupyterlab_execute_time directory
# Install package in development mode
pip install -e .
# Link your development version of the extension with JupyterLab
jupyter labextension develop . --overwrite
# Rebuild extension Typescript source after making changes
jlpm run build

您可以在不同的终端中同时监视源目录并运行JupyterLab,以监视扩展的源代码变化并自动重新构建扩展。

# Watch the source directory in one terminal, automatically rebuilding when needed
jlpm run watch
# Run JupyterLab in another terminal
jupyter lab

当监视命令运行时,每次保存的更改都会立即在本地构建并可供运行的JupyterLab使用。刷新JupyterLab以在浏览器中加载更改(您可能需要等待几秒钟以便重新构建扩展)。

默认情况下,jlpm run build命令为此扩展生成源映射,以便更容易使用浏览器开发者工具进行调试。要为JupyterLab核心扩展也生成源映射,可以运行以下命令

jupyter lab build --minimize=False

发布

开始之前,您需要运行:pip install twine jupyter_packaging

  1. 更新package.json中的版本并更新CHANGELOG.md中的发布日期
  2. 提交步骤1中的更改,打上标签,然后推送
git commit -am <msg>
git tag vX.Z.Y
git push && git push --tags
  1. 创建工件
rm -rf dist build jupyterlab_execute_time/labextension
jlpm run build
python setup.py sdist bdist_wheel
  1. 对此进行测试,以测试测试PyPI。您也可以从这里安装以进行测试
twine upload --repository-url https://test.pypi.org/legacy/ dist/*
# In a new venv
pip install --index-url https://test.pypi.org/simple/ jupyterlab_execute_time
  1. 将其上传到PyPI
twine upload dist/*

卸载

pip uninstall jupyterlab_execute_time

历史记录

此插件由D. E. Shaw小组贡献回社区。

D. E. Shaw Logo

许可证

此项目在BSD-3-Clause许可证下发布。

我们喜欢贡献!在您能够贡献之前,请签署并提交此贡献者许可协议(CLA)。此CLA是为了保护此项目的所有用户。

"Jupyter"是NumFOCUS基金会的商标,Project Jupyter是其一部分。

项目详情


下载文件

下载适用于您的平台的文件。如果您不确定选择哪个,请了解更多关于安装包的信息。

源分布

jupyterlab_execute_time-3.2.0.tar.gz (340.5 kB 查看散列)

上传时间

构建分布

jupyterlab_execute_time-3.2.0-py3-none-any.whl (527.1 kB 查看散列)

上传于 Python 3

支持者