[BUG]: Duplicate `FigureWidget` import code in `graph_objects` and `graph_objs`
维护者通常 2 天内回复
评估
调研方向
从 codegen/__init__.py 中的 optional_figure_widget_import 开始,然后阅读 write_init_py 和 build_from_imports_py 如何生成两个包初始化文件。比较 plotly/graph_objs/__init__.py 和 plotly/graph_objects/__init__.py 中的 FigureWidget 代码块;完成标准是生成的代码保留现有的可选 ipywidgets 导入和缺少依赖项时的回退逻辑,同时只输出一次该代码块。检查 issue #5238 中引用的回退测试。
由索引模型根据 Issue 内容生成。
描述
Description
The FigureWidget import code is duplicated in graph_objects and graph_objs.
Steps to reproduce
- Open
codegen/__init__.pyand findoptional_figure_widget_import. - Note that the codegen passes the string to
write_init_pyforgraph_objsand tobuild_from_imports_pyforgraph_objects. - Open
plotly/graph_objs/__init__.pyandplotly/graph_objects/__init__.py. - Note the identical
FigureWidgetblocks at the end of each file.
Notes
- The codegen writes the same optional
FigureWidgetimport block into two generated files:plotly/graph_objs/__init__.pyandplotly/graph_objects/__init__.py graph_objectsalready re-exports every other class fromgraph_objs, includingFigure.FigureWidgetcan follow the same path, becausegraph_objshandles the optionalipywidgetsimport and themissing_*fallback.- Any fix should not change behavior. This is just about removing duplicate code.
- Related:
- #3779 (closed, edited the generated file by hand)
- #5238 (test for the missing
FigureWidgetfallback)
- 主要语言
- Python
- 星标
- 18.9k
- 派生
- 2.9k
- 平均合并
- 1 天 22 小时
- 30 天内合并 PR
- 12
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
plotly/plotly.py 的其他 Issue
-
to_typed_array_spec encodes bdata in host byte order; plotly.js always decodes it as little-endian可能已有人在做 @Vikram12301 于 11 天前认领。 未关闭bug P3 size: 1
难度 2/5 1-3 小时 新手友好度 79/100
plotly/plotly.py#5837 · 1 条评论 ·
维护者通常 2 天内回复
-
[BUG]: NaT inside a datetime64 array serializes as the string "NaT" instead of null可能已有人在做 @senanurcetin 于 13 天前认领。 未关闭bug P3 size: 1
难度 2/5 1-3 小时 新手友好度 82/100
plotly/plotly.py#5829 · 3 条评论 ·
维护者通常 2 天内回复
-
[BUG]: Integer and string properties reject NumPy scalars可能已有人在做 @RaphaelFakhri 于 14 天前认领。 未关闭bug P3 size: 1
难度 2/5 1-3 小时 新手友好度 70/100
plotly/plotly.py#5827 · 1 条评论 ·
维护者通常 2 天内回复
-
[BUG]: Single-color requests raise ZeroDivisionError in palette helpers可能已有人在做 @MokiMeow 于 23 天前认领。 未关闭bug P3 size: 1
难度 2/5 1-3 小时 新手友好度 82/100
plotly/plotly.py#5805 · 1 条评论 ·
维护者通常 2 天内回复
-
[BUG]: Unnecessary `UserWarning` when using `fig.write_image()` with `kaleido.start_sync_server()`可能已有人在做 @jayzhou2309 于 32 天前认领。 未关闭bug P3 size: 1
难度 2/5 1-3 小时 新手友好度 74/100
plotly/plotly.py#5786 · 1 条评论 ·
维护者通常 2 天内回复
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
enhancement good first issue
难度 2/5 1-3 小时 新手友好度 78/100
elviskahoro/sdk-python-attio#144 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 84/100
维护者通常 1 天内回复
-
RenyiELBO raises TypeError when model has no sample sites可能已有人在做 @alibb007 今天认领。 未关闭
难度 1/5 1 小时以内 新手友好度 85/100
维护者通常 1 天内回复
-
[Bug]: Four evaluation scripts unpack init_memmachine_params's five return values into three names未关闭
难度 1/5 1 小时以内 新手友好度 88/100
MemMachine/MemMachine#1911 ·
维护者通常 3 天内回复