matplotlib / matplotlib/ipympl

DeprecationWarning with traitlets when using %matplotlib widget

未关闭
#236 1 条评论 4 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

主要语言
Jupyter Notebook
星标
1.7k
派生
234
PR 合并指标
30 天内没有已合并 PR

描述

Describe the issue

It seems that the widget backend is doing something that is deprecated, and I thought I should make a note of it here.
Example:

import warnings
import matplotlib.pyplot as plt

%matplotlib widget
warnings.simplefilter("always", DeprecationWarning) 
plt.subplots()

I get the following warnings

/home/maij/.local/lib/python3.6/site-packages/ipywidgets/widgets/widget.py:412: DeprecationWarning: Passing unrecoginized arguments to super(Canvas).__init__().
__init__() missing 1 required positional argument: 'figure'
This is deprecated in traitlets 4.2.This error will be raised in a future release of traitlets.
  super(Widget, self).__init__(**kwargs)
/home/maij/.local/lib/python3.6/site-packages/ipywidgets/widgets/widget.py:412: DeprecationWarning: Passing unrecoginized arguments to super(Toolbar).__init__().
__init__() missing 1 required positional argument: 'canvas'
This is deprecated in traitlets 4.2.This error will be raised in a future release of traitlets.
  super(Widget, self).__init__(**kwargs)

Versions

 3.6.9 (default, Apr 18 2020, 01:56:04) 
[GCC 8.4.0]
ipympl version: 0.5.6
jupyter core     : 4.6.3
jupyter-notebook : 6.0.3
qtconsole        : 4.7.4
ipython          : 7.13.0
ipykernel        : 5.2.0
jupyter client   : 6.1.3
jupyter lab      : 2.1.4
nbconvert        : 6.0.0a0
ipywidgets       : 7.5.1
nbformat         : 5.0.4
traitlets        : 4.3.3
JupyterLab v2.1.4
Known labextensions:
   app dir: /usr/local/share/jupyter/lab
        @jupyter-widgets/jupyterlab-manager v2.0.0  enabled  OK
        @jupyter-widgets/jupyterlab-sidecar v0.5.0  enabled  OK
        jupyter-matplotlib v0.7.2  enabled  OK
        shared_kernel v0.1.0  enabled  OK

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

首先使用提供的 Python 代码片段和 %matplotlib widget 后端重现警告,然后跟踪 traceback 中提到的 Canvas 和 Toolbar 初始化过程。将行为与列出的 ipympl、ipywidgets 和 traitlets 版本进行比较;完成的标准是示例不再发出这些 DeprecationWarning 消息,并且该行为由适当的回归检查覆盖。

由索引模型根据 Issue 内容生成。

评估

技术栈
jupyter-notebook, python
领域
frontend
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。