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

オープン
#7,372 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
48/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
python
領域
data

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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)
"""

主要言語
Python
スター
730
フォーク
323
平均マージ
3日 21時間
マージ済み PR(30日)
16

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

SciTools/iris のほかの issue

SciTools/iris の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。