@@ -21,7 +21,7 @@ async function get_v2(
21
21
let root = path . resolve ( __dirname , "../../../fixtures/v2/data.zarr" ) ;
22
22
let store = zarr . root ( new FSStore ( root ) ) ;
23
23
let arr = await zarr . open . v2 ( store . resolve ( abs_path ) , { kind : "array" } ) ;
24
- return get ( arr as any , ...args ) ;
24
+ return get ( arr , ...args ) ;
25
25
}
26
26
27
27
describe ( "get v2" , ( ) => {
@@ -215,31 +215,51 @@ describe("get v2", () => {
215
215
` ) ;
216
216
} ) ;
217
217
218
- it . skip ( "1d.contiguous.U13.le" , async ( ) => {
218
+ it ( "1d.contiguous.U13.le" , async ( ) => {
219
219
let res = await get_v2 ( "/1d.contiguous.U13.le" ) ;
220
220
expect ( res . data ) . toBeInstanceOf ( UnicodeStringArray ) ;
221
- expect ( Array . from ( res . data as any ) ) . toStrictEqual ( [ "a" , "b" , "cc" , "d" ] ) ;
221
+ expect ( Array . from ( res . data as UnicodeStringArray ) ) . toStrictEqual ( [
222
+ "a" ,
223
+ "b" ,
224
+ "cc" ,
225
+ "d" ,
226
+ ] ) ;
222
227
expect ( res . shape ) . toStrictEqual ( [ 4 ] ) ;
223
228
} ) ;
224
229
225
- it . skip ( "1d.contiguous.U13.be" , async ( ) => {
230
+ it ( "1d.contiguous.U13.be" , async ( ) => {
226
231
let res = await get_v2 ( "/1d.contiguous.U13.be" ) ;
227
232
expect ( res . data ) . toBeInstanceOf ( UnicodeStringArray ) ;
228
- expect ( Array . from ( res . data as any ) ) . toStrictEqual ( [ "a" , "b" , "cc" , "d" ] ) ;
233
+ expect ( Array . from ( res . data as UnicodeStringArray ) ) . toStrictEqual ( [
234
+ "a" ,
235
+ "b" ,
236
+ "cc" ,
237
+ "d" ,
238
+ ] ) ;
229
239
expect ( res . shape ) . toStrictEqual ( [ 4 ] ) ;
230
240
} ) ;
231
241
232
- it . skip ( "1d.contiguous.U7" , async ( ) => {
242
+ it ( "1d.contiguous.U7" , async ( ) => {
233
243
let res = await get_v2 ( "/1d.contiguous.U7" ) ;
234
244
expect ( res . data ) . toBeInstanceOf ( UnicodeStringArray ) ;
235
- expect ( Array . from ( res . data as any ) ) . toStrictEqual ( [ "a" , "b" , "cc" , "d" ] ) ;
245
+ expect ( Array . from ( res . data as UnicodeStringArray ) ) . toStrictEqual ( [
246
+ "a" ,
247
+ "b" ,
248
+ "cc" ,
249
+ "d" ,
250
+ ] ) ;
236
251
expect ( res . shape ) . toStrictEqual ( [ 4 ] ) ;
237
252
} ) ;
238
253
239
- it . skip ( "1d.contiguous.S7" , async ( ) => {
254
+ it ( "1d.contiguous.S7" , async ( ) => {
240
255
let res = await get_v2 ( "/1d.contiguous.S7" ) ;
241
256
expect ( res . data ) . toBeInstanceOf ( ByteStringArray ) ;
242
- expect ( Array . from ( res . data as any ) ) . toStrictEqual ( [ "a" , "b" , "cc" , "d" ] ) ;
257
+ expect ( Array . from ( res . data as UnicodeStringArray ) ) . toStrictEqual ( [
258
+ "a" ,
259
+ "b" ,
260
+ "cc" ,
261
+ "d" ,
262
+ ] ) ;
243
263
expect ( res . shape ) . toStrictEqual ( [ 4 ] ) ;
244
264
} ) ;
245
265
@@ -391,9 +411,14 @@ describe("get v2", () => {
391
411
` ) ;
392
412
} ) ;
393
413
394
- it . skip ( "2d.chunked.U7" , async ( ) => {
414
+ it ( "2d.chunked.U7" , async ( ) => {
395
415
let res = await get_v2 ( "/2d.chunked.U7" ) ;
396
- expect ( Array . from ( res . data as any ) ) . toStrictEqual ( [ "a" , "b" , "cc" , "d" ] ) ;
416
+ expect ( Array . from ( res . data as UnicodeStringArray ) ) . toStrictEqual ( [
417
+ "a" ,
418
+ "b" ,
419
+ "cc" ,
420
+ "d" ,
421
+ ] ) ;
397
422
expect ( res . shape ) . toStrictEqual ( [ 2 , 2 ] ) ;
398
423
} ) ;
399
424
@@ -535,7 +560,7 @@ describe("get v2", () => {
535
560
} ) ;
536
561
} ) ;
537
562
538
- async function read_complete_v3 (
563
+ async function get_v3 (
539
564
abs_path : string ,
540
565
...args : any [ ]
541
566
) : Promise < zarr . Chunk < zarr . DataType > > {
@@ -547,55 +572,55 @@ async function read_complete_v3(
547
572
548
573
describe ( "get v3" , ( ) => {
549
574
it ( "reads 1d.contiguous.gzip.i2" , async ( ) => {
550
- let res = await read_complete_v3 ( "/1d.contiguous.gzip.i2" ) ;
575
+ let res = await get_v3 ( "/1d.contiguous.gzip.i2" ) ;
551
576
expect ( res . data ) . toStrictEqual ( new Int16Array ( [ 1 , 2 , 3 , 4 ] ) ) ;
552
577
expect ( res . shape ) . toStrictEqual ( [ 4 ] ) ;
553
578
} ) ;
554
579
555
580
it ( "reads 1d.contiguous.blosc.i2" , async ( ) => {
556
- let res = await read_complete_v3 ( "/1d.contiguous.blosc.i2" ) ;
581
+ let res = await get_v3 ( "/1d.contiguous.blosc.i2" ) ;
557
582
expect ( res . data ) . toStrictEqual ( new Int16Array ( [ 1 , 2 , 3 , 4 ] ) ) ;
558
583
expect ( res . shape ) . toStrictEqual ( [ 4 ] ) ;
559
584
} ) ;
560
585
561
586
it ( "reads 1d.contiguous.raw.i2" , async ( ) => {
562
- let res = await read_complete_v3 ( "/1d.contiguous.raw.i2" ) ;
587
+ let res = await get_v3 ( "/1d.contiguous.raw.i2" ) ;
563
588
expect ( res . data ) . toStrictEqual ( new Int16Array ( [ 1 , 2 , 3 , 4 ] ) ) ;
564
589
expect ( res . shape ) . toStrictEqual ( [ 4 ] ) ;
565
590
} ) ;
566
591
567
592
it ( "reads 1d.contiguous.i4" , async ( ) => {
568
- let res = await read_complete_v3 ( "/1d.contiguous.i4" ) ;
593
+ let res = await get_v3 ( "/1d.contiguous.i4" ) ;
569
594
expect ( res . data ) . toStrictEqual ( new Int32Array ( [ 1 , 2 , 3 , 4 ] ) ) ;
570
595
expect ( res . shape ) . toStrictEqual ( [ 4 ] ) ;
571
596
} ) ;
572
597
573
598
it ( "reads 1d.contiguous.u1" , async ( ) => {
574
- let res = await read_complete_v3 ( "/1d.contiguous.u1" ) ;
599
+ let res = await get_v3 ( "/1d.contiguous.u1" ) ;
575
600
expect ( res . data ) . toStrictEqual ( new Uint8Array ( [ 255 , 0 , 255 , 0 ] ) ) ;
576
601
expect ( res . shape ) . toStrictEqual ( [ 4 ] ) ;
577
602
} ) ;
578
603
579
604
it ( "reads 1d.contiguous.f4.le" , async ( ) => {
580
- let res = await read_complete_v3 ( "/1d.contiguous.f4.le" ) ;
605
+ let res = await get_v3 ( "/1d.contiguous.f4.le" ) ;
581
606
expect ( res . data ) . toStrictEqual ( new Float32Array ( [ - 1000.5 , 0 , 1000.5 , 0 ] ) ) ;
582
607
expect ( res . shape ) . toStrictEqual ( [ 4 ] ) ;
583
608
} ) ;
584
609
585
610
it ( "reads 1d.contiguous.f4.be" , async ( ) => {
586
- let res = await read_complete_v3 ( "/1d.contiguous.f4.be" ) ;
611
+ let res = await get_v3 ( "/1d.contiguous.f4.be" ) ;
587
612
expect ( res . data ) . toStrictEqual ( new Float32Array ( [ - 1000.5 , 0 , 1000.5 , 0 ] ) ) ;
588
613
expect ( res . shape ) . toStrictEqual ( [ 4 ] ) ;
589
614
} ) ;
590
615
591
616
it ( "reads 1d.contiguous.f8" , async ( ) => {
592
- let res = await read_complete_v3 ( "/1d.contiguous.f8" ) ;
617
+ let res = await get_v3 ( "/1d.contiguous.f8" ) ;
593
618
expect ( res . data ) . toStrictEqual ( new Float64Array ( [ 1.5 , 2.5 , 3.5 , 4.5 ] ) ) ;
594
619
expect ( res . shape ) . toStrictEqual ( [ 4 ] ) ;
595
620
} ) ;
596
621
597
622
it ( "reads 1d.contiguous.b1" , async ( ) => {
598
- let res = await read_complete_v3 ( "/1d.contiguous.b1" ) ;
623
+ let res = await get_v3 ( "/1d.contiguous.b1" ) ;
599
624
expect ( res . data ) . toBeInstanceOf ( BoolArray ) ;
600
625
expect ( Array . from ( res . data as BoolArray ) ) . toStrictEqual ( [
601
626
true ,
@@ -607,56 +632,56 @@ describe("get v3", () => {
607
632
} ) ;
608
633
609
634
it ( "reads 2d.contiguous.i2" , async ( ) => {
610
- let res = await read_complete_v3 ( "/2d.contiguous.i2" ) ;
635
+ let res = await get_v3 ( "/2d.contiguous.i2" ) ;
611
636
expect ( res . data ) . toStrictEqual ( new Int16Array ( [ 1 , 2 , 3 , 4 ] ) ) ;
612
637
expect ( res . shape ) . toStrictEqual ( [ 2 , 2 ] ) ;
613
638
} ) ;
614
639
615
640
it ( "reads 3d.contiguous.i2" , async ( ) => {
616
- let res = await read_complete_v3 ( "/3d.contiguous.i2" ) ;
641
+ let res = await get_v3 ( "/3d.contiguous.i2" ) ;
617
642
expect ( res . data ) . toStrictEqual ( new Int16Array ( range ( 27 ) ) ) ;
618
643
expect ( res . shape ) . toStrictEqual ( [ 3 , 3 , 3 ] ) ;
619
644
} ) ;
620
645
621
646
it ( "reads 1d.chunked.i2" , async ( ) => {
622
- let res = await read_complete_v3 ( "/1d.chunked.i2" ) ;
647
+ let res = await get_v3 ( "/1d.chunked.i2" ) ;
623
648
expect ( res . data ) . toStrictEqual ( new Int16Array ( [ 1 , 2 , 3 , 4 ] ) ) ;
624
649
expect ( res . shape ) . toStrictEqual ( [ 4 ] ) ;
625
650
} ) ;
626
651
627
652
it ( "reads 1d.chunked.ragged.i2" , async ( ) => {
628
- let res = await read_complete_v3 ( "/1d.chunked.ragged.i2" ) ;
653
+ let res = await get_v3 ( "/1d.chunked.ragged.i2" ) ;
629
654
expect ( res . data ) . toStrictEqual ( new Int16Array ( [ 1 , 2 , 3 , 4 , 5 ] ) ) ;
630
655
expect ( res . shape ) . toStrictEqual ( [ 5 ] ) ;
631
656
} ) ;
632
657
633
658
it ( "reads 2d.chunked.i2" , async ( ) => {
634
- let res = await read_complete_v3 ( "/2d.chunked.i2" ) ;
659
+ let res = await get_v3 ( "/2d.chunked.i2" ) ;
635
660
expect ( res . data ) . toStrictEqual ( new Int16Array ( [ 1 , 2 , 3 , 4 ] ) ) ;
636
661
expect ( res . shape ) . toStrictEqual ( [ 2 , 2 ] ) ;
637
662
} ) ;
638
663
639
664
it ( "reads 2d.chunked.ragged.i2" , async ( ) => {
640
- let res = await read_complete_v3 ( "/2d.chunked.ragged.i2" ) ;
665
+ let res = await get_v3 ( "/2d.chunked.ragged.i2" ) ;
641
666
expect ( res . data ) . toStrictEqual ( new Int16Array ( range ( 1 , 10 ) ) ) ;
642
667
expect ( res . shape ) . toStrictEqual ( [ 3 , 3 ] ) ;
643
668
} ) ;
644
669
645
670
it ( "reads 3d.chunked.i2" , async ( ) => {
646
- let res = await read_complete_v3 ( "/3d.chunked.i2" ) ;
671
+ let res = await get_v3 ( "/3d.chunked.i2" ) ;
647
672
expect ( res . data ) . toStrictEqual ( new Int16Array ( range ( 27 ) ) ) ;
648
673
expect ( res . shape ) . toStrictEqual ( [ 3 , 3 , 3 ] ) ;
649
674
} ) ;
650
675
651
676
it ( "reads 3d.chunked.mixed.i2.C" , async ( ) => {
652
- let res = await read_complete_v3 ( "/3d.chunked.mixed.i2.C" ) ;
677
+ let res = await get_v3 ( "/3d.chunked.mixed.i2.C" ) ;
653
678
expect ( res . data ) . toStrictEqual ( new Int16Array ( range ( 27 ) ) ) ;
654
679
expect ( res . shape ) . toStrictEqual ( [ 3 , 3 , 3 ] ) ;
655
680
expect ( res . stride ) . toStrictEqual ( [ 9 , 3 , 1 ] ) ;
656
681
} ) ;
657
682
658
683
it ( "reads 3d.chunked.mixed.i2.F" , async ( ) => {
659
- let res = await read_complete_v3 ( "/3d.chunked.mixed.i2.F" ) ;
684
+ let res = await get_v3 ( "/3d.chunked.mixed.i2.F" ) ;
660
685
// deno-fmt-ignore
661
686
expect ( res . data ) . toStrictEqual ( new Int16Array ( [
662
687
0 , 9 , 18 , 3 , 12 , 21 , 6 , 15 , 24 ,
@@ -668,7 +693,7 @@ describe("get v3", () => {
668
693
} ) ;
669
694
670
695
it ( "reads 3d.chunked.mixed.i2.F -- force C" , async ( ) => {
671
- let res = await read_complete_v3 ( "/3d.chunked.mixed.i2.F" , null , {
696
+ let res = await get_v3 ( "/3d.chunked.mixed.i2.F" , null , {
672
697
order : "C" ,
673
698
} ) ;
674
699
expect ( res . data ) . toStrictEqual ( new Int16Array ( range ( 27 ) ) ) ;
0 commit comments