Consider adding opt-in support for circular axes when calling `bounds_to_vertices` (related to #594)
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 38/100
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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
- Lingua principale
- Python
- Stelle
- 181
- Fork
- 49
- Merge medio
- 43m
- PR unite (30g)
- 1
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di xarray-contrib/cf-xarray
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
xarray-contrib/cf-xarray#623 ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 25/100
xarray-contrib/cf-xarray#570 ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 15/100
xarray-contrib/cf-xarray#568 ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
xarray-contrib/cf-xarray#566 · 2 commenti ·
-
Conflict in unit alias Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
xarray-contrib/cf-xarray#543 · 14 commenti ·
Tutte le issue di xarray-contrib/cf-xarray
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
qgis/QGIS-Documentation#11275 ·
-
bug priority:normal ready-for-dev
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
OpenHands/extensions#626 · 1 commento ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
CSCfi/sd-search-api#39 ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
-
please add to porn list Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
StevenBlack/hosts#3255 ·