Rework the netCDF saver's createVariable keyword API
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
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
(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.
- Lingua principale
- Python
- Stelle
- 730
- Fork
- 323
- Merge medio
- 3g 21h
- PR unite (30g)
- 16
Preparare l'ambiente
- 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 SciTools/iris
-
Link Checker ReportForse già presa @stephenworsley l’ha presa 12 giorni fa. ApertaBot Type: Bug Type: Documentation
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
SciTools/iris#7368 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
I maintainer di solito rispondono entro 1 giorno
-
guess_bounds(yearly=True) fails on a single point, monthly=True worksForse già presa @pp-mo l’ha presa 47 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 90/100
SciTools/iris#7311 · 2 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Agentic
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di SciTools/iris
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 80/100
UKGovernmentBEIS/inspect_ai#6733 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
ProyectoRespira/respira-webapp#334 ·
I maintainer di solito rispondono entro 1 giorno
-
bug security-alert
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
spectrayan/carefold#391 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
Jakeschincariol/instagram-agent-skill#83 ·
I maintainer di solito rispondono entro 10 giorni
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 64/100