Precision change in regular PP-grid coordinates
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
Start by reading iris.util.regular_points and the change linked in the issue, then reproduce the reported call with the given zeroth, step, and count values. Compare the first coordinate with the float64 result and inspect the existing tests for regular point generation. Done means the generated coordinates retain the expected precision for this case and the relevant tests pass.
索引モデルが issue の本文から書いたものです。
説明
🐛 Bug Report
A change in the handling of dtypes (introduced to iris as part of Numpy 2 upgrade) has resulted in some files being loaded at a lower precision.
The change in behaviour was introduced in iris.util.regular_points, which first attempts to create a regular set of points as float32, and if that is not regular, re-attempts with float64. There are cases where the zeroth and step are float64, but are cast to float32, resulting in a regular array at a lower precision.
How To Reproduce
Steps to reproduce the behaviour:
- Start with a UM file with the following field headers:
...
(16) lbcode : 101 # Indicates regular lat-lon grid, rotated pole
(17) lbhem : 3
(18) lbrow : 190 # Number of points in y
(19) lbnpt : 190 # Number of points in x
...
(59) bzy : -0.27500000000000213 # Zeroth y point
(60) bdy : 0.11 # Step in y
(61) bzx : 341.30499999999995 # Zeroth x point
(62) bdx : 0.11 # Step in x
...
- In the pp load, in constructing the x coordinate, the following function will be called:
x = iris.util.regular_points(zeroth=341.30499999999995, step=0.11, count=190)
- The resulting array has a dtype of
float32, even though the inputs werefloat64. Compare the first element of the array, with the result of doing the calculation with native python floats (or with explicit numpy float64):
>>> x[0]
np.float32(341.41498)
>>> 341.30499999999995 + 0.11
341.41499999999996
>>> np.add(341.30499999999995, 0.11, dtype="float64")
np.float64(341.41499999999996)
The expected start longitude is actually included in the file, as entry 4 of the real constants - and it matches the float64 calculation:
%%%%%%%%%%%%%%%%%%
* real_constants *
%%%%%%%%%%%%%%%%%%
(1) col_spacing : 0.11
(2) row_spacing : 0.11
(3) start_lat : -0.1650000000000027
(4) start_lon : 341.41499999999996
(5) north_pole_lat : 39.25
(6) north_pole_lon : 198.0
Environment
- OS & Version: Red Hat Enterprise Linux release 9.8 (Plow)
- Iris Version: 3.15, but looks to have been introduced from 3.11
Additional context
Click to expand this section...
Can provide example file on request.- 主要言語
- Python
- スター
- 730
- フォーク
- 323
- 平均マージ
- 3日 21時間
- マージ済み PR(30日)
- 16
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
SciTools/iris のほかの issue
-
Link Checker Report対応中かも @stephenworsley が 12 日前に担当しました。 オープンBot Type: Bug Type: Documentation
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
SciTools/iris#7368 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
メンテナーはふだん 1 日以内に返信
-
guess_bounds(yearly=True) fails on a single point, monthly=True works対応中かも @pp-mo が 47 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 90/100
SciTools/iris#7311 · コメント 2 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
Agentic
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
メンテナーはふだん 1 日以内に返信
似ている issue
-
bug game: 0100FF500E34A000 game: 0400FF500E34A001 mac packing
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 2 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
jxxghp/MoviePilot#7576 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
jbaruch/software-factory#266 ·
メンテナーはふだん 1 日以内に返信
-
cron: raise a distinct error when next_fire finds no match in its search bound (from #813 item 5)オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信