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

Aperta
#7,353 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
48/100
Tipo di issue
Refactoring
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
python
Ambito
backend

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
Python
Stelle
730
Fork
323
Merge medio
3g 21h
PR unite (30g)
16

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di SciTools/iris

Tutte le issue di SciTools/iris

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.