@@ -2,11 +2,6 @@ import * as path from "node:path";
2
2
import * as url from "node:url" ;
3
3
import * as zarr from "@zarrita/core" ;
4
4
import FSStore from "@zarrita/storage/fs" ;
5
- import {
6
- BoolArray ,
7
- ByteStringArray ,
8
- UnicodeStringArray ,
9
- } from "@zarrita/typedarray" ;
10
5
import { describe , expect , it } from "vitest" ;
11
6
12
7
import { get } from "../src/ops.js" ;
@@ -218,49 +213,29 @@ describe("get v2", () => {
218
213
219
214
it ( "1d.contiguous.U13.le" , async ( ) => {
220
215
let res = await get_v2 ( "/1d.contiguous.U13.le" ) ;
221
- expect ( res . data ) . toBeInstanceOf ( UnicodeStringArray ) ;
222
- expect ( Array . from ( res . data as UnicodeStringArray ) ) . toStrictEqual ( [
223
- "a" ,
224
- "b" ,
225
- "cc" ,
226
- "d" ,
227
- ] ) ;
216
+ expect ( res . data ) . toBeInstanceOf ( zarr . UnicodeStringArray ) ;
217
+ expect ( Array . from ( res . data ) ) . toStrictEqual ( [ "a" , "b" , "cc" , "d" ] ) ;
228
218
expect ( res . shape ) . toStrictEqual ( [ 4 ] ) ;
229
219
} ) ;
230
220
231
221
it ( "1d.contiguous.U13.be" , async ( ) => {
232
222
let res = await get_v2 ( "/1d.contiguous.U13.be" ) ;
233
- expect ( res . data ) . toBeInstanceOf ( UnicodeStringArray ) ;
234
- expect ( Array . from ( res . data as UnicodeStringArray ) ) . toStrictEqual ( [
235
- "a" ,
236
- "b" ,
237
- "cc" ,
238
- "d" ,
239
- ] ) ;
223
+ expect ( res . data ) . toBeInstanceOf ( zarr . UnicodeStringArray ) ;
224
+ expect ( Array . from ( res . data ) ) . toStrictEqual ( [ "a" , "b" , "cc" , "d" ] ) ;
240
225
expect ( res . shape ) . toStrictEqual ( [ 4 ] ) ;
241
226
} ) ;
242
227
243
228
it ( "1d.contiguous.U7" , async ( ) => {
244
229
let res = await get_v2 ( "/1d.contiguous.U7" ) ;
245
- expect ( res . data ) . toBeInstanceOf ( UnicodeStringArray ) ;
246
- expect ( Array . from ( res . data as UnicodeStringArray ) ) . toStrictEqual ( [
247
- "a" ,
248
- "b" ,
249
- "cc" ,
250
- "d" ,
251
- ] ) ;
230
+ expect ( res . data ) . toBeInstanceOf ( zarr . UnicodeStringArray ) ;
231
+ expect ( Array . from ( res . data ) ) . toStrictEqual ( [ "a" , "b" , "cc" , "d" ] ) ;
252
232
expect ( res . shape ) . toStrictEqual ( [ 4 ] ) ;
253
233
} ) ;
254
234
255
235
it ( "1d.contiguous.S7" , async ( ) => {
256
236
let res = await get_v2 ( "/1d.contiguous.S7" ) ;
257
- expect ( res . data ) . toBeInstanceOf ( ByteStringArray ) ;
258
- expect ( Array . from ( res . data as UnicodeStringArray ) ) . toStrictEqual ( [
259
- "a" ,
260
- "b" ,
261
- "cc" ,
262
- "d" ,
263
- ] ) ;
237
+ expect ( res . data ) . toBeInstanceOf ( zarr . ByteStringArray ) ;
238
+ expect ( Array . from ( res . data ) ) . toStrictEqual ( [ "a" , "b" , "cc" , "d" ] ) ;
264
239
expect ( res . shape ) . toStrictEqual ( [ 4 ] ) ;
265
240
} ) ;
266
241
@@ -277,12 +252,7 @@ describe("get v2", () => {
277
252
],
278
253
}
279
254
` ) ;
280
- expect ( Array . from ( res . data as BoolArray ) ) . toStrictEqual ( [
281
- true ,
282
- false ,
283
- true ,
284
- false ,
285
- ] ) ;
255
+ expect ( Array . from ( res . data ) ) . toStrictEqual ( [ true , false , true , false ] ) ;
286
256
} ) ;
287
257
288
258
it ( "2d.contiguous.i2" , async ( ) => {
@@ -414,12 +384,7 @@ describe("get v2", () => {
414
384
415
385
it ( "2d.chunked.U7" , async ( ) => {
416
386
let res = await get_v2 ( "/2d.chunked.U7" ) ;
417
- expect ( Array . from ( res . data as UnicodeStringArray ) ) . toStrictEqual ( [
418
- "a" ,
419
- "b" ,
420
- "cc" ,
421
- "d" ,
422
- ] ) ;
387
+ expect ( Array . from ( res . data ) ) . toStrictEqual ( [ "a" , "b" , "cc" , "d" ] ) ;
423
388
expect ( res . shape ) . toStrictEqual ( [ 2 , 2 ] ) ;
424
389
} ) ;
425
390
@@ -545,9 +510,9 @@ describe("get v2", () => {
545
510
let res = await get_v2 ( "/3d.chunked.mixed.i2.F" ) ;
546
511
// biome-ignore format: the array should not be formatted
547
512
expect ( res . data ) . toStrictEqual ( new Int16Array ( [
548
- 0 , 9 , 18 , 3 , 12 , 21 , 6 , 15 , 24 ,
549
- 1 , 10 , 19 , 4 , 13 , 22 , 7 , 16 , 25 ,
550
- 2 , 11 , 20 , 5 , 14 , 23 , 8 , 17 , 26 ,
513
+ 0 , 9 , 18 , 3 , 12 , 21 , 6 , 15 , 24 ,
514
+ 1 , 10 , 19 , 4 , 13 , 22 , 7 , 16 , 25 ,
515
+ 2 , 11 , 20 , 5 , 14 , 23 , 8 , 17 , 26 ,
551
516
] ) ) ;
552
517
expect ( res . shape ) . toStrictEqual ( [ 3 , 3 , 3 ] ) ;
553
518
expect ( res . stride ) . toStrictEqual ( [ 1 , 3 , 9 ] ) ;
@@ -632,8 +597,8 @@ describe("get v3", () => {
632
597
633
598
it ( "1d.contiguous.b1" , async ( ) => {
634
599
let res = await get_v3 ( "/1d.contiguous.b1" ) ;
635
- expect ( res . data ) . toBeInstanceOf ( BoolArray ) ;
636
- expect ( Array . from ( res . data as BoolArray ) ) . toStrictEqual ( [
600
+ expect ( res . data ) . toBeInstanceOf ( zarr . BoolArray ) ;
601
+ expect ( Array . from ( res . data as zarr . BoolArray ) ) . toStrictEqual ( [
637
602
true ,
638
603
false ,
639
604
true ,
@@ -695,9 +660,9 @@ describe("get v3", () => {
695
660
let res = await get_v3 ( "/3d.chunked.mixed.i2.F" ) ;
696
661
// biome-ignore format: the array should not be formatted
697
662
expect ( res . data ) . toStrictEqual ( new Int16Array ( [
698
- 0 , 9 , 18 , 3 , 12 , 21 , 6 , 15 , 24 ,
699
- 1 , 10 , 19 , 4 , 13 , 22 , 7 , 16 , 25 ,
700
- 2 , 11 , 20 , 5 , 14 , 23 , 8 , 17 , 26 ,
663
+ 0 , 9 , 18 , 3 , 12 , 21 , 6 , 15 , 24 ,
664
+ 1 , 10 , 19 , 4 , 13 , 22 , 7 , 16 , 25 ,
665
+ 2 , 11 , 20 , 5 , 14 , 23 , 8 , 17 , 26 ,
701
666
] ) ) ;
702
667
expect ( res . shape ) . toStrictEqual ( [ 3 , 3 , 3 ] ) ;
703
668
expect ( res . stride ) . toStrictEqual ( [ 1 , 3 , 9 ] ) ;
0 commit comments