Consider adding opt-in support for circular axes when calling `bounds_to_vertices` (related to #594)
まだ誰も着手していません。
評価
調査の方向性
Start by reading the bounds_to_vertices implementation and the context in issues #594 and #595. Define the expected behavior for circular_period and start, including seam rotation and periodic axes beyond longitude. Done means an opt-in API handles mixed circular coordinates without NotImplementedError while preserving existing ascending and descending behavior.
索引モデルが issue の本文から書いたものです。
説明
Description
The latest bounds_to_vertices() function in cf-xarray v0.10.7+ only handles core dimensions that are in ascending or descending order. Core dims that are in mixed order instead raise a NotImplementedError #595 with a message for the user to normalize coordinates to a monotonic convention (related comment).
Examples
-
Ascending
[0, 1, 2, ..., 357, 358, 359] -
Descending
[359, 358, 357, ..., 2, 1, 0] -
Mixed (wraps at seam)
[0, 1, 2, ..., 179, -180, -179, ..., -1]
bounds_to_vertices() works in the first two cases but fails in the third.
Proposed solution
For a long-term solution, it might be worth considering opt-in support for circular axes, e.g.:
bounds_to_vertices(..., circular_period=360.0, start=None)
With circular_period set, cf-xarray could:
- Detect circular monotonicity
- Rotate away from the seam
- Proceed safely as if the dimension were monotonic
While longitude (circular_period=360.0) is the most common use case, the same approach could generalize to other periodic axes (e.g. angles, phases).
Why it is useful
- Users working with model output that mixes
0–360and−180–180conventions may encounterNotImplementedErrortoday and must manually normalize coordinates before downstream operations. - This affects packages such as xESMF, which rely on
bounds_to_vertices()but do not implement detection/normalization for circular axes. - I’ve opened a related xESMF issue for visibility: https://github.com/pangeo-data/xESMF/issues/454
- 主要言語
- Python
- スター
- 181
- フォーク
- 49
- 平均マージ
- 43分
- マージ済み PR(30日)
- 1
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
xarray-contrib/cf-xarray のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
xarray-contrib/cf-xarray#623 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 25/100
xarray-contrib/cf-xarray#570 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 15/100
xarray-contrib/cf-xarray#568 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
xarray-contrib/cf-xarray#566 · コメント 2 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
xarray-contrib/cf-xarray#543 · コメント 14 件 ·
xarray-contrib/cf-xarray の issue をすべて見る
似ている issue
-
bug confirmed issue
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
open-webui/open-webui#30750 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
OpenwaterHealth/openmotion-bloodflow-app#604 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
-
good first issue
難易度 1/5 1時間未満 初心者へのやさしさ 90/100