Zarr v3 Struct Support & Tensorstore

オープン
#241 コメント 3 件 リアクション 2 件 担当者 0 名 GitHub で見る

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

  • #264 @BrianMichell による — マージされずにクローズ

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
30/100
issue の種類
機能追加
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
cpp, python
領域
data

調査の方向性

まず、TensorStore の Zarr v2 および v3 ドライバーと、構造化 dtypes に関する Zarr メタデータ定義を比較します。次に、提供された Xarray/Python の例を Zarr v3 と sharding を使って再現し、その後、v3 ドライバーが現在何をサポートしているかを確認します。実装に関する推奨事項を文書化し、可能であれば v3 ドライバーを通じて構造化フィールドをサポートできれば完了です。

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

説明

Hi @jbms @laramiel

Zarr-Python version 3.1.0 just got released and the v3 arrays now support flexible datatypes. One (not yet marked stable) implementation is the numpy structs as if they were in zarr v2. Below example shows a Zarr that's created with Xarray that holds 2 variables (one struct, one normal) as zarr v3 and sharding.

My understanding is the V3 driver in tensorstore doesn't support numpy structs either. However, I believe it should be trivial because the binaries didn't change between zarr v2/v3 but only metadata definition of the same struct changed. Which means we can make v3 driver parse the zarr metadata and use the same logic to read the structured fields as in v2 driver?

What are your recommendations for implementation?

import numpy as np
import xarray as xr

dtype = np.dtype(
    {
        "names": ["foo", "bar"],
        "formats": ["int32", "int64"],
    }
)

encoding = {
    "headers": {"chunks": (128, 128)},
    "seismic": {"chunks": (16, 16, 16), "shards": (128, 128, 128)}
}
seis = xr.DataArray(name="seismic", dims=["inline", "crossline", "depth"], data=np.zeros((512, 512, 512), dtype="float32"))
hdr = xr.DataArray(name="headers", dims=["inline", "crossline"], data=np.zeros((512, 512), dtype=dtype))

ds = xr.Dataset({"seismic": seis, "headers": hdr})
ds.to_zarr("tmp", mode="w", zarr_format=3, encoding=encoding)
主要言語
C++
スター
1.6k
フォーク
151
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

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

google/tensorstore のほかの issue

google/tensorstore の issue をすべて見る

似ている issue

C++ の issue をもっと見る

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

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