WIP, introducing a unified API for reading v2 & v3, and writing v3.
Open v3
import * as zarr from "@zarrita/core";
import { FileSystemStore } from "@zarrita/storage";
let store = zarr.root(new FileSystemStore("teststore"));
let node = await zarr.open(store.resolve("foo")); // type Array | Group
let arr = await zarr.open(store.resolve("foo"), { kind: "array" }); // type Array
let grp = await zarr.open(store.resolve("baz"), { kind: "group" }) // type Group
Open v2
import * as zarr from "@zarrita/core";
import { FileSystemStore } from "@zarrita/storage";
let store = zarr.root(new FileSystemStore("teststore"), { version: "2" });
let node = await zarr.open(store.resolve("foo")); // type Array | Group
let arr = await zarr.open(store.resolve("foo"), { kind: "array" }); // type Array
let grp = await zarr.open(store.resolve("baz"), { kind: "group" }) // type Group
Write v3
import * as zarr from "@zarrita/core";
import { FileSystemStore } from "@zarrita/storage";
let store = zarr.root(new FileSystemStore("teststore"));
let arr = await zarr.create(store.resolve("foo"), {
shape: [100, 100],
data_type: "int32",
chunk_shape: [10, 10],
});
let grp = await zarr.create(store.resolve("baz"), { attributes: { answer: 42 } });
Write v2 (throws)
import * as zarr from "@zarrita/core";
import { FileSystemStore } from "@zarrita/storage";
let store = zarr.root(new FileSystemStore("teststore"), { version: "2" });
let arr = await zarr.create(store.resolve("foo"), {
shape: [100, 100],
data_type: "int32",
chunk_shape: [10, 10],
}); // throws!
WIP, introducing a unified API for reading v2 & v3, and writing v3.
Open v3
Open v2
Write v3
Write v2 (throws)