_map_title crashes for orthographic maps with UnboundLocalError: xpt
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 52/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 停滞
- 技术栈
- python
调研方向
首先定位 _map_title,并使用所述的默认设置重现带有非空标题的最小 ortho 等值线图。跟踪 xpt 和 ypt 在每个投影中的赋值方式,然后验证正交投影图能够带标题进行渲染,且不会产生 UnboundLocalError。
由索引模型根据 Issue 内容生成。
描述
This actually occurs for other plot types as well.
Version: cfplot 3.4.0; python 3.12
Observed behavior:
- Orthographic contour plot crashes when cf-plot tries to render the map title
- If the title is removed, the plot renders successfully
Expected behavior:
- Orthographic contour plots should render with a title
- At minimum, _map_title should not crash if a projection-specific title anchor has not been computed
Minimal failing scenario:
- Projection: ortho
- Default GUI-style settings:
- [lat_0 = 0.0]
- [lon_0 = 0.0
- Render a contour plot with a non-empty title
Probable root cause:
_map_title() appears to compute xpt, ypt only for some projections, then unconditionally uses them in the non-dims branch.
From the installed 3.4.0 source, the title-anchor coordinates are assigned for cases such as:
- npstere
- spstere
- lcc
but later the code does:
else:
halign = "center"
plotvars.mymap.text(
xpt,
ypt,
title,
...
)
For ortho, xpt/ypt do not appear to be initialized before this branch is reached.
- 主要语言
- Python
- 星标
- 21
- 派生
- 11
- 平均合并
- 7 小时 11 分钟
- 30 天内合并 PR
- 1
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
NCAS-CMS/cf-plot 的其他 Issue
-
testing
难度 3/5 1-2 天 新手友好度 58/100
-
docs enhancement
难度 3/5 1-2 天 新手友好度 64/100
-
Add animation hooks into cf-plot可能重新可做 @bnlawrence 于 99 天前认领,目前没有进行中的 PR。 未关闭enhancement
-
bug v35plus
难度 4/5 3-5 天 新手友好度 35/100
-
难度 4/5 3-5 天 新手友好度 45/100
相似的 Issue
-
Maven path-index: "Ambiguous or noncanonical artifact path" error does not report the offending path未关闭
难度 2/5 1-3 小时 新手友好度 76/100
pulp/pulp_maven#524 ·
维护者通常 1 天内回复
-
难度 1/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 3 天内回复
-
难度 1/5 1-3 小时 新手友好度 88/100
infinispan/langchain-infinispan#34 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 85/100
521xueweihan/HelloGitHub#3891 ·