Unify the netCDF and Zarr cube-building loops, and the mesh format dispatch

Abierto
#7,353 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
48/100
Tipo de issue
Refactorización
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
python
Área
backend

Línea de trabajo

Read iris.fileformats.netcdf.loader.load_cubes, iris.fileformats.zarr.loader.load_cubes, and iris.fileformats.netcdf.ugrid_load.load_meshes, then review section 5 of docs/superpowers/specs/2026-09-21-zarr-io-design.md. Compare the shared loader bodies and the mesh format dispatch; use the existing loader tests to check both formats. Done when the shared loop is unified, the dispatch is removed, and both load_cubes signatures remain unchanged.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Agentic Type: Tech Debt

(posted by Claude Opus)

iris.fileformats.netcdf.loader.load_cubes and iris.fileformats.zarr.loader.load_cubes now have the same body. They differ only in how the dataset is opened: one builds a NetCDFDataset, the other a ZarrDataset, and everything after that — the CF reader, the mesh handling, the cube loop, the callback — is the same code written twice.

iris.fileformats.netcdf.ugrid_load.load_meshes carries a third copy of the problem, as a format dispatch that compares the handler against nc_loader.load_cubes and _load_zarr to decide what to open. That comparison is the only reason a netCDF-named module names Zarr at all; the mesh code it shares with the Zarr loader names no format whatsoever. A TODO in that function points here.

Unifying the loop would remove the dispatch with it. Neither load_cubes signature moves, so this is internal.

Raised at the merge-back of the native Zarr programme rather than when it was found, so that nobody started on it while that programme's pull requests were in flight and depending on each other. Found by @pp-mo reviewing https://github.com/SciTools/iris/pull/7336. See section 5 of docs/superpowers/specs/2026-09-21-zarr-io-design.md.

Lenguaje dominante
Python
Estrellas
730
Forks
323
Merge medio
3 d 21 h
PR fusionados (30 d)
16

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de SciTools/iris

Todos los issues de SciTools/iris

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.