Iris Zarr format saves "normal" fixed-width character arrays as a "string" type (variable-width) array

Aperta
#7,372 1 commento 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
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
python
Ambito
data

Direzione di ricerca

Start by tracing Iris's Zarr save and load paths and their tests for fixed-width Unicode arrays; the issue does not name specific files or tests. Reproduce saving a Uxx array and inspect the resulting Zarr metadata, then compare with the existing load behavior. Done means saving and loading preserves the fixed-width dtype, with the warning behavior considered.

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

Descrizione

From experiment it seems that:

  • Iris won't save 'object' type string arrays to Zarr
  • Iris will save "Uxx" character data (fixed-width strings) but save them as variable-length strings
    • (i.e. zarr metadata has "dtype" = "string")

Zarr itself (i.e. zarr.create_array) can create either.
It won't handle dtype="O", but can do either :

  • "StringDtype" --> zarr "data_type" = "string"
  • "Uxx" --> zarr "data_type" is "fixed_length_utf32"
    • n.b. with extension format metadata[^1]
    • but with a warning^2

I think we should support fixed-width strings in a way which round-trips.

And importantly ..

Where Zarr content has fixed-length strings of the 'fixed_length_utf32' type, Iris does load these correctly as "Uxx" type arrays.
(But with the warning)


[^1]: example for data of dtype "U11"
"""
"data_type": {"name": "fixed_length_utf32",
"configuration": {
"length_bytes": 44
}
},
"""

UnstableSpecificationWarning: The data type (FixedLengthUTF32(length=11, endianness='little')) does not have a Zarr V3 specification. That means that the representation of arrays saved with this data type may change without warning in a future version of Zarr Python. Arrays stored with this data type may be unreadable by other Zarr libraries. Use this data type at your own risk! Check https://github.com/zarr-developers/zarr-extensions/tree/main/data-types for the status of data type specifications for Zarr V3.
v3_unstable_dtype_warning(self)
"""

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.