Rework the netCDF saver's createVariable keyword API
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
Línea de trabajo
Start by reading the netCDF save API in iris.fileformats.netcdf and the public iris.save interface, then review ChunkControl and the linked Zarr I/O design discussion (#7292). The issue describes a breaking API change that needs a deprecation path and further discussion; a concrete implementation boundary and acceptance criteria are not settled.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
(posted by Claude Opus)
Raised from @pp-mo's review of the Zarr I/O design spec: https://github.com/SciTools/iris/pull/7292#discussion_r4155142914
The problem
iris.fileformats.netcdf.save names every netCDF4 createVariable keyword in its own signature — zlib, complevel, shuffle, fletcher32, contiguous, chunksizes, endian, least_significant_digit — and threads each one down through several call layers to the point of use. All of them are also reachable from iris.save(cube, "out.nc", zlib=True).
@pp-mo's objection, in his words:
Frankly, I don't like the existing API and I wonder if all this is just bending over backwards to maintain it ??? It "would have been" better, in my (retrospective!) view, to not name all the available netCDF
createVariablekeywords in our API, and instead support any arbitrary keywords not specifically managed by Iris, as a pass-through. Although .. it is still necessary to have a mechanism for providing controls on a per-variable (i.e. per-cube) basis. Even there, I think that the CHUNK_CONTROL demonstrates a much better way of managing this kind of thing --- notably, a context-manager rather than specific 'tunnel-through' keywords passed unmodified through multiple call layers.
Three things fall out of the current shape:
- Every new netCDF4 keyword is an Iris API change, and every keyword Iris names is one it has to keep naming.
- The keywords are per-call, not per-cube, so
iris.save(cubes, "out.nc", complevel=4)applies one setting to every cube in the list. Per-variable control needs a dict-valued keyword, which is the workaround that exists today. - The values travel through functions that have no interest in them, which is the thing
CHUNK_CONTROLwas introduced to stop doing for chunking.
The suggested direction
Pass arbitrary unrecognised keywords through to createVariable rather than enumerating them, and express per-variable control the way ChunkControl does — a context manager scoped around the save, matching variables by name.
Scope and caution
This is a breaking change, and unlike most of iris.fileformats.netcdf it is not confined to super-users: iris.save(cube, "out.nc", zlib=True) is documented and ordinary. It needs its own deprecation path, and probably its own discussion before any of that.
It is explicitly out of scope for the Zarr I/O programme (#6961). That programme does take one decision in its shadow: the Zarr saver will accept Zarr-native keywords (compressors, chunks, shards) rather than translating netCDF ones onto codecs, so new API does not inherit the pattern. A netCDF keyword passed to the Zarr saver raises TypeError naming the Zarr replacement.
- Lenguaje dominante
- Python
- Estrellas
- 730
- Forks
- 323
- Merge medio
- 3 d 21 h
- PR fusionados (30 d)
- 16
Preparar el entorno
- 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 SciTools/iris
-
Link Checker ReportPosiblemente ocupada @stephenworsley la tomó hace 12 días. AbiertoBot Type: Bug Type: Documentation
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
SciTools/iris#7368 · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
Los mantenedores suelen responder en 1 día
-
guess_bounds(yearly=True) fails on a single point, monthly=True worksPosiblemente ocupada @pp-mo la tomó hace 47 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 90/100
SciTools/iris#7311 · 2 comentarios · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
Agentic
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
Los mantenedores suelen responder en 1 día
Todos los issues de SciTools/iris
Issues similares
-
bug game: 0100FF500E34A000 game: 0400FF500E34A001 mac packing
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 2 días
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
jxxghp/MoviePilot#7576 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 64/100
jbaruch/software-factory#266 ·
Los mantenedores suelen responder en 1 día
-
cron: raise a distinct error when next_fire finds no match in its search bound (from #813 item 5)Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día