1- # @ zarrita/core
1+ # zarrita
22
33The primary engine for interacting with Zarr in JavaScript. Navigate a store
44hierarchy and load individual array chunks.
@@ -42,16 +42,15 @@ array chunks on-demand.
4242
4343## Navigation
4444
45- The ** @ zarrita/core ** module introduces a ` Location ` primitive to navigate
45+ The ** zarrita** module introduces a ` Location ` primitive to navigate
4646through a storage hierarchy. This object associates a ** path** with a ** store**
4747(i.e., a specific location in the hierarchy), and exposes a useful ` resolve `
4848helper:
4949
5050``` javascript
51- import * as zarr from " @zarrita/core" ;
52- import { FetchStore } from " @zarrita/storage" ;
51+ import * as zarr from " zarrita" ;
5352
54- let root = zarr .root (new FetchStore (" http://localhost:8080/data.zarr" ));
53+ let root = zarr .root (new zarr. FetchStore (" http://localhost:8080/data.zarr" ));
5554root .store ; // FetchStore
5655root .path ; // "/"
5756
@@ -69,10 +68,9 @@ foo.path; // "/foo"
6968Using a ` Location ` , you can access an ** array** or ** group** with ` open ` :
7069
7170``` javascript
72- import * as zarr from " @zarrita/core" ;
73- import { FetchStore } from " @zarrita/storage" ;
71+ import * as zarr from " zarrita" ;
7472
75- let root = zarr .root (new FetchStore (" http://localhost:8080/data.zarr" ));
73+ let root = zarr .root (new zarr. FetchStore (" http://localhost:8080/data.zarr" ));
7674let node = await zarr .open (root);
7775node; // zarr.Array<DataType, FetchStore> | zarr.Group
7876```
@@ -142,7 +140,7 @@ view.get(1, 3); // 7
142140Given a ` Location ` , you can also create an ** array** or ** group** with ` create ` :
143141
144142``` javascript
145- import * as zarr from " @ zarrita/core " ;
143+ import * as zarr from " zarrita" ;
146144
147145let root = zarr .root (new Map ());
148146let grp = await zarr .create (root);
@@ -170,7 +168,7 @@ While slicing and indexing are foundational concepts as in Zarr, they are
170168presented through a higher-level (optional) API in ** zarrita** . This choice
171169caters to applications that might prefer direct interaction with chunks.
172170
173- You can use either ** @ zarrita/core ** or ** @zarrita/ndarray ** to conveniently
171+ You can use either ** zarrita** or ** @zarrita/ndarray ** to conveniently
174172access specific data subsets without thinking about chunking details.
175173
176174### How to slice
@@ -212,12 +210,12 @@ region = arr[10:20, ..., 0]
212210## Data Typing in TypeScript
213211
214212Zarr's dynamic nature presents a challenge in accurately representing data types
215- to static type systems. ** @ zarrita/core ** leverages TypeScript's advanced typing
213+ to static type systems. ** zarrita** leverages TypeScript's advanced typing
216214capabilities to extract and communicate Zarr ` data_type ` metadata across its
217215APIs.
218216
219217In essense, you (moreover your editor) is always informed about the data types
220- at hand when working with Zarr via ** @ zarrita/core ** . TypeScript assists in
218+ at hand when working with Zarr via ** zarrita** . TypeScript assists in
221219covering edge cases, but (importantly) steps back once you've demonstrated data
222220correctness.
223221
@@ -259,7 +257,7 @@ But what about when the data type isn't known? Let's say we now `open` a remote
259257Zarr array:
260258
261259``` javascript
262- let store = new FetchStore (" http://localhost:8080/data.zarr" );
260+ let store = new zarr. FetchStore (" http://localhost:8080/data.zarr" );
263261let arr = await zarr .open (store);
264262let chunk = await arr .getChunk ([0 , 0 ]);
265263
@@ -289,8 +287,7 @@ Instead, wouldn't it be convenient if you could verify the data type once, and
289287then TypeScript would automatically understand the expected data type for all
290288subsequent ` getChunk ` calls?
291289
292- ** @zarrita/core ** introduces the ` zarr.Array.is ` type guard to achieve just
293- that:
290+ ** zarrita** introduces the ` zarr.Array.is ` type guard to achieve just that:
294291
295292``` javascript
296293if (! arr .is (" int64" ) || ! arr .is (" uint64" )) {
0 commit comments