Feature Request: First-class representation of nested attributes
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 30/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Da chiarire
- Stato di attività
- Ferma
- Stack tecnologico
- python
- Ambito
- developer-experience
Direzione di ricerca
Inizia tracciando i percorsi repr() e HTML repr di xarray in Jupyter, quindi esamina come vengono attualmente visualizzati ds.attrs e gli attributi dei gruppi. Definisci l'ambito della rappresentazione prima dell'implementazione; l'implementazione completata dovrebbe rendere visibilmente strutturati gli oggetti e gli array profondamente annidati, e qualsiasi comportamento espandibile richiesto dovrebbe essere coperto da test della rappresentazione.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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).
- Lingua principale
- Python
- Stelle
- 4.2k
- Fork
- 1.5k
- Merge medio
- 2g 20h
- PR unite (30g)
- 70
Preparare l'ambiente
Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
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 pydata/xarray
-
xarray removes axis grid from pcolormeshForse già presa @Sealdot l’ha presa 1 giorno fa. Apertabug needs triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
I maintainer di solito rispondono entro 1 giorno
-
`DataTree.map_over_datasets` behavior can be obscure sometimesForse già presa @mohansree14 l’ha presa 24 giorni fa. Apertaneeds triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
pydata/xarray#11813 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Comparing attrs that contain a dict of NumPy arrays raises ValueError in identical / assert_identicalForse già presa @SohamXYZDev l’ha presa 30 giorni fa. Apertabug needs triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 73/100
pydata/xarray#11777 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
RangeIndex` with datetime64 bounds cannot be printed (`Unknown format code 'g'`)Forse già presa @d-chambers l’ha presa 61 giorni fa. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
pydata/xarray#11598 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
DataTree constructor error message says dict even though dict is not acceptedForse già presa @aryansk l’ha presa 100 giorni fa. Apertabug contrib-good-first-issue topic-DataTree topic-error reporting
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
pydata/xarray#11514 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di pydata/xarray
Issue simili
-
LLMContextNode tool builders fail on nested params like `params:retrieval.max_matches`Forse già presa @Shizoqua l’ha presa oggi. ApertaCommunity
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 2 giorni
-
security
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
btclib-org/portanode#985 ·
I maintainer di solito rispondono entro 1 giorno
-
[Bug]: maps skill OSRM foot/cycling returns car times (router.project-osrm.org ignores profile)Apertacomp/tools P2 tool/skills type/bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
NousResearch/hermes-agent#158494 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
I maintainer di solito rispondono entro 1 giorno
-
needs-format
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
Niko1221/Strata#6475 · 1 commento ·
I maintainer di solito rispondono entro 6 giorni