Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cookbook docs not consistent #217

Open
ondave opened this issue Oct 13, 2024 · 1 comment
Open

Cookbook docs not consistent #217

ondave opened this issue Oct 13, 2024 · 1 comment
Labels
documentation Improvements or additions to documentation

Comments

@ondave
Copy link

ondave commented Oct 13, 2024

Cookbook docs out of date? Args for zarr.create are different from @zarrita/core docs.

https://zarrita.dev/cookbook.html#create-an-array

import * as zarr from "zarrita";
import { FileSystemStore } from "@zarrita/storage";

const store = new FileSystemStore("tempstore");
const arr = await zarr.create(store, {
	shape: [10, 10],
	chunks: [5, 5],
	dtype: "int32",
});
arr; // zarr.Array<"int32", FileSystemStore>

https://zarrita.dev/packages/core.html#create-an-array-or-group

import * as zarr from "@zarrita/core";

let root = zarr.root(new Map());
let grp = await zarr.create(root);
let arr = await zarr.create(root.resolve("foo"), {
	data_type: "int32",
	shape: [4, 4],
	chunk_shape: [2, 2],
});
console.log(root.store);
// Map(2) {
//   '/zarr.json' => Uint8Array(66) [ ... ],
//   '/foo/zarr.json' => Uint8Array(392) [ ... ],
// }
@manzt
Copy link
Owner

manzt commented Oct 15, 2024

Thanks for pointing this out. The snake_case usage is correct, although before making a non- prerelease release we want to migrate to camelCase for all public APIs.

@manzt manzt added the documentation Improvements or additions to documentation label Oct 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants