Feature Request: First-class representation of nested attributes
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 30/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Necesita aclaración
- Estado de actividad
- Estancado
- Stack tecnológico
- python
- Área
- developer-experience
Línea de trabajo
Empieza rastreando las rutas de repr() y de la representación HTML de xarray en Jupyter; después, inspecciona cómo se muestran actualmente ds.attrs y los atributos de los grupos. Define el alcance de la representación antes de la implementación; el resultado debería hacer que los objetos y arrays profundamente anidados se vean estructurados, y que cualquier comportamiento expandible solicitado quede cubierto por pruebas de representación.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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).
- Lenguaje dominante
- Python
- Estrellas
- 4.2k
- Forks
- 1.5k
- Merge medio
- 2 d 20 h
- PR fusionados (30 d)
- 70
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de pydata/xarray
-
xarray removes axis grid from pcolormeshPosiblemente ocupada @Sealdot la tomó hace 1 día. Abiertobug needs triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
Los mantenedores suelen responder en 1 día
-
`DataTree.map_over_datasets` behavior can be obscure sometimesPosiblemente ocupada @mohansree14 la tomó hace 24 días. Abiertoneeds triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
pydata/xarray#11813 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Comparing attrs that contain a dict of NumPy arrays raises ValueError in identical / assert_identicalPosiblemente ocupada @SohamXYZDev la tomó hace 30 días. Abiertobug needs triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 73/100
pydata/xarray#11777 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
RangeIndex` with datetime64 bounds cannot be printed (`Unknown format code 'g'`)Posiblemente ocupada @d-chambers la tomó hace 61 días. Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
pydata/xarray#11598 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
-
DataTree constructor error message says dict even though dict is not acceptedPosiblemente ocupada @aryansk la tomó hace 100 días. Abiertobug contrib-good-first-issue topic-DataTree topic-error reporting
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
pydata/xarray#11514 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
Todos los issues de pydata/xarray
Issues similares
-
LLMContextNode tool builders fail on nested params like `params:retrieval.max_matches`Posiblemente ocupada @Shizoqua la tomó hoy. AbiertoCommunity
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 2 días
-
security
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
btclib-org/portanode#985 ·
Los mantenedores suelen responder en 1 día
-
[Bug]: maps skill OSRM foot/cycling returns car times (router.project-osrm.org ignores profile)Abiertocomp/tools P2 tool/skills type/bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
NousResearch/hermes-agent#158494 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
Los mantenedores suelen responder en 1 día
-
needs-format
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Niko1221/Strata#6475 · 1 comentario ·
Los mantenedores suelen responder en 6 días