Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Consider adding opt-in support for circular axes when calling `bounds_to_vertices` (related to #594)

オープン
#596 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
38/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
python
領域
data

調査の方向性

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–360 and −180–180 conventions may encounter NotImplementedError today 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

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

xarray-contrib/cf-xarray のほかの issue

xarray-contrib/cf-xarray の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。