Consider adding opt-in support for circular axes when calling `bounds_to_vertices` (related to #594)
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 38/100
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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
- Ngôn ngữ chính
- Python
- Star
- 181
- Fork
- 49
- Merge trung bình
- 43 phút
- Pull request đã merge (30 ngày)
- 1
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của xarray-contrib/cf-xarray
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
xarray-contrib/cf-xarray#623 ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 25/100
xarray-contrib/cf-xarray#570 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 15/100
xarray-contrib/cf-xarray#568 ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
xarray-contrib/cf-xarray#566 · 2 bình luận ·
-
Conflict in unit alias Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
xarray-contrib/cf-xarray#543 · 14 bình luận ·
Tất cả issue của xarray-contrib/cf-xarray
Issue tương tự
-
[Bug] reef-hermes tells me to resume with hermes --resume, which does not work from my shell Đang mởarea: harness bug status: needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Human-Agent-Society/reef#625 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 80/100
learningequality/kolibri#15351 · 2 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
Name consistency Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
eellak/triplestore#65 · 1 bình luận ·