Skip to content

Commit 97210f6

Browse files
authored
Consolidate @zarrita/core into zarrita (#269)
1 parent 8191ccd commit 97210f6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+601
-623
lines changed

.changeset/new-peaches-share.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
"@zarrita/core": patch
3+
"@zarrita/ndarray": patch
4+
"@zarrita/storage": patch
5+
"zarrita": patch
6+
---
7+
8+
Consolidate @zarrita/core into zarrita

.github/workflows/jsr.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,16 @@ jobs:
1919

2020
- name: Publish @zarrita/storage
2121
run: deno publish --unstable-sloppy-imports
22-
working-directory: packages/storage
23-
24-
- name: Publish @zarrita/core
25-
run: deno publish --unstable-sloppy-imports
26-
working-directory: packages/core
22+
working-directory: packages/@zarrita-storage
2723

2824
- name: Publish @zarrita/zarrita
2925
run: deno publish --unstable-sloppy-imports
3026
working-directory: packages/zarrita
3127

28+
- name: Publish @zarrita/core
29+
run: deno publish --unstable-sloppy-imports
30+
working-directory: packages/@zarrita-core
31+
3232
- name: Publish @zarrita/ndarray
3333
run: deno publish --unstable-sloppy-imports
34-
working-directory: packages/ndarray
34+
working-directory: packages/@zarrita-ndarray

demo.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66
<script type="importmap">
77
{
88
"imports": {
9-
"zarrita": "./packages/zarrita/dist/index.js",
10-
"@zarrita/core": "./packages/core/dist/src/index.js",
9+
"zarrita": "./packages/zarrita/dist/src/index.js",
1110
"@zarrita/storage/fetch": "./packages/storage/dist/src/fetch.js",
1211
"numcodecs/blosc": "./packages/core/node_modules/numcodecs/blosc.js",
1312
"numcodecs/lz4": "./packages/core/node_modules/numcodecs/lz4.js",

docs/get-started.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ automatically loads the other dependencies.
7575
{
7676
"imports": {
7777
"zarrita": "https://unpkg.com/zarrita@next",
78-
"@zarrita/core": "https://unpkg.com/@zarrita/core@next",
7978
"@zarrita/storage/fetch": "https://unpkg.com/@zarrita/storage@next/dist/src/fetch.js",
8079
"numcodecs/blosc": "https://unpkg.com/numcodecs@0.3/blosc",
8180
"numcodecs/lz4": "https://unpkg.com/numcodecs@0.3/lz4",
Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# @zarrita/core
1+
# zarrita
22

33
The primary engine for interacting with Zarr in JavaScript. Navigate a store
44
hierarchy 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
4646
through 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`
4848
helper:
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"));
5554
root.store; // FetchStore
5655
root.path; // "/"
5756

@@ -69,10 +68,9 @@ foo.path; // "/foo"
6968
Using 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"));
7674
let node = await zarr.open(root);
7775
node; // zarr.Array<DataType, FetchStore> | zarr.Group
7876
```
@@ -142,7 +140,7 @@ view.get(1, 3); // 7
142140
Given 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

147145
let root = zarr.root(new Map());
148146
let grp = await zarr.create(root);
@@ -170,7 +168,7 @@ While slicing and indexing are foundational concepts as in Zarr, they are
170168
presented through a higher-level (optional) API in **zarrita**. This choice
171169
caters 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
174172
access 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

214212
Zarr'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
216214
capabilities to extract and communicate Zarr `data_type` metadata across its
217215
APIs.
218216

219217
In 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
221219
covering edge cases, but (importantly) steps back once you've demonstrated data
222220
correctness.
223221

@@ -259,7 +257,7 @@ But what about when the data type isn't known? Let's say we now `open` a remote
259257
Zarr 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");
263261
let arr = await zarr.open(store);
264262
let 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
289287
then TypeScript would automatically understand the expected data type for all
290288
subsequent `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
296293
if (!arr.is("int64") || !arr.is("uint64")) {

docs/what-is-zarrita.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ allows **zarrita** to be both <u>minimal and feature complete</u> if necessary.
2929
**zarrita** is broken down into several packages to create and interact with
3030
Zarr.
3131

32-
### [@zarrita/core](/packages/core)
32+
### [zarrita](/packages/zarrita)
3333

3434
- Navigate a storage hierarchy and `open` or `create` **groups** and **arrays**.
3535
- Load individual array **chunks** on-demand based on their key.

0 commit comments

Comments
 (0)