Zarr won't save character arrays loaded from netCDF, as they are always masked

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

Direzione di ricerca

Start by reading the lazy netCDF masking logic in lib/iris/fileformats/netcdf/_thread_safe_nc.py around the linked lines, then trace how masked character arrays are handled during Zarr saving. The issue leaves the solution open: assess whether saving can tolerate these arrays, possibly with a warning. Done means lazy character arrays loaded from netCDF can be saved to Zarr without incorrectly failing.

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

Descrizione

At least, this is true for lazy arrays.
This means, notably, that they will not save to Zarr

When loading data arrays from netCDF4, you can never be sure whether a given data load will return normal or masked data.
So, when wrapping in dask, we label every array as masked.
Though the actual loaded results will typically be "normal" arrays.

workaround:

the data arrays can be transformed by wrapping with e,g,

  • da.ma.filled(arr, "\0") [missing chars are zero bytes]
  • da.ma.getdata(arr) [ignore any masking + return raw array as read]

solutions?

We can't reasonably fix the loaded data so it is unmasked, not without scanning it all (since it is lazy),
( and it's not even clear that treating character data as an exception case is a good idea )
Instead, we could fix Zarr saving to tolerate this (with possible warning)

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.