Skip to main content

在 Jupyter Lab 中显示单元计时

项目描述

jupyterlab-执行时间

PyPI 版本 PyPI DM Github 操作状态 粘合剂

在 Jupyter Lab 中显示单元计时

执行时间截图

这是受这里的笔记本版本启发的。

注意:要显示任何内容,您需要通过 Settings->Advanced Settings Editor->Notebook: 在笔记本中启用单元格计时{"recordTiming": true}。这是笔记本元数据设置,而不是插件设置。该插件仅显示此数据。

要求

  • JupyterLab >= 3.0

安装

pip使用运行安装此软件包

pip install jupyterlab_execute_time

conda使用运行安装此软件包

conda install -c conda-forge jupyterlab_execute_time

贡献

开发安装

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

jlpm命令是与 JupyterLab 一起安装的 JupyterLab 的固定版本 yarn。您可以使用 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

运行 watch 命令后,每个保存的更改都将立即在本地构建并在您正在运行的 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
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

历史

该插件由DE Shaw 组回馈给社区。

德肖标志

执照

这个项目是在BSD-3-Clause 许可下发布的。

“Jupyter”是 NumFOCUS 基金会的商标,Jupyter 项目是其中的一部分。

项目详情


下载文件

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

源分布

jupyterlab_execute_time-2.1.0.tar.gz (158.8 kB 查看哈希

已上传 source

内置分布

jupyterlab_execute_time-2.1.0-py3-none-any.whl (165.1 kB 查看哈希

已上传 py3