Feature Request: First-class representation of nested attributes
Maintainer thường phản hồi trong vòng 1 ngày
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
- 30/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Cần làm rõ
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- python
- Lĩnh vực
- developer-experience
Hướng nghiên cứu
Bắt đầu bằng cách truy vết các đường dẫn repr() và HTML repr của xarray trong Jupyter, sau đó kiểm tra cách ds.attrs và các thuộc tính của group hiện đang được hiển thị. Xác định phạm vi của biểu diễn trước khi triển khai; khi hoàn tất, phần triển khai phải hiển thị các object và array lồng nhau sâu theo cấu trúc rõ ràng, đồng thời mọi hành vi có thể mở rộng được yêu cầu phải được bao phủ bằng các bài kiểm thử biểu diễn.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Is your feature request related to a problem?
Formats such as Zarr store group attributes in JSON (e.g. .zattrs), so attributes can be deeply nested (objects and arrays). The current xarray APIs and built-in representations (e.g. repr(), HTML repr in Jupyter) typically expose attributes in a flat or single-level way. That makes it hard to inspect or document complex metadata in the IDE or in notebooks. Users either see a flattened view, truncated output, or have to manually traverse raw attribute dicts instead of seeing the structure xarray actually has at hand.
Xarray current HTML representation (only top-level attributes are shown, with full content):
Describe the solution you'd like
First-class support for nested attributes in xarray’s APIs and/or representations, for example:
- Repr / HTML repr: Optionally render nested attributes as an expandable/collapsible tree (or at least with clear indentation/structure) instead of a single-level or flattened dump, so users can see the full hierarchy in Jupyter and other environments that rely on xarray’s built-in repr.
The goal is that opening a dataset with rich nested metadata (e.g. from Zarr) feels natural in xarray: the repr and APIs should reflect that nesting rather than flattening or hiding it.
Describe alternatives you've considered
- Manual traversal: Users can already walk
ds.attrs(or group attrs) and pretty-print themselves. This doesn’t improve the default experience in Jupyter or the consistency of tooling. - Downstream-only handling: Some tools (e.g. Scientific Data Viewer) can render nested attributes in a tree view on the viewer side. That helps when using those tools but doesn’t improve the experience for users who only use xarray’s built-in repr or other consumers that follow xarray’s representation.
- Leaving attributes as “opaque” dicts: Keeps implementation simple but under-serves users and formats (like Zarr) where nested metadata is the norm.
Example: Scientific Data Viewer nested representation of nested attributes with collapsible sections:
Additional context
- This would benefit anyone opening Zarr (or similar) datasets with rich
.zattrs-style metadata in Jupyter or scripts. - Downstream projects (e.g. Scientific Data Viewer) could align their UIs with xarray’s representation for consistency when the same dataset is opened in xarray and in other tools.
- Reference: Scientific Data Viewer – xarray and nested attributes (doc that motivated this request).
- Ngôn ngữ chính
- Python
- Star
- 4.2k
- Fork
- 1.5k
- Merge trung bình
- 2 ngày 20 giờ
- Pull request đã merge (30 ngày)
- 70
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
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 pydata/xarray
-
xarray removes axis grid from pcolormeshCó thể đã có người làm @Sealdot đã nhận 1 ngày trước. Đang mởbug needs triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
Maintainer thường phản hồi trong vòng 1 ngày
-
`DataTree.map_over_datasets` behavior can be obscure sometimesCó thể đã có người làm @mohansree14 đã nhận 24 ngày trước. Đang mởneeds triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
pydata/xarray#11813 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Comparing attrs that contain a dict of NumPy arrays raises ValueError in identical / assert_identicalCó thể đã có người làm @SohamXYZDev đã nhận 30 ngày trước. Đang mởbug needs triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 73/100
pydata/xarray#11777 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
RangeIndex` with datetime64 bounds cannot be printed (`Unknown format code 'g'`)Có thể đã có người làm @d-chambers đã nhận 61 ngày trước. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
pydata/xarray#11598 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
DataTree constructor error message says dict even though dict is not acceptedCó thể đã có người làm @aryansk đã nhận 100 ngày trước. Đang mởbug contrib-good-first-issue topic-DataTree topic-error reporting
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
pydata/xarray#11514 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của pydata/xarray
Issue tương tự
-
LLMContextNode tool builders fail on nested params like `params:retrieval.max_matches`Có thể đã có người làm @Shizoqua đã nhận hôm nay. Đang mởCommunity
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 2 ngày
-
security
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
btclib-org/portanode#985 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Bug]: maps skill OSRM foot/cycling returns car times (router.project-osrm.org ignores profile)Đang mởcomp/tools P2 tool/skills type/bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
NousResearch/hermes-agent#158494 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
Maintainer thường phản hồi trong vòng 1 ngày
-
needs-format
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Niko1221/Strata#6475 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 6 ngày