@@ -22,18 +22,18 @@ using CommonDataModel: iswritable, attribnames, parentdataset
22
22
close (ds)
23
23
24
24
ds = NCDataset (nczarr_name)
25
- ds2 = ZarrDataset (fname)
25
+ dsz = ZarrDataset (fname)
26
26
27
- @test Set (dimnames (ds2 )) == Set (dimnames (ds))
27
+ @test Set (dimnames (dsz )) == Set (dimnames (ds))
28
28
29
29
for (name,len) in ds. dim
30
- @test ds2 . dim[name] == len
30
+ @test dsz . dim[name] == len
31
31
end
32
32
33
33
for (varname,v) in ds
34
- @test haskey (ds2 ,varname)
34
+ @test haskey (dsz ,varname)
35
35
36
- v2 = ds2 [varname]
36
+ v2 = dsz [varname]
37
37
@test Array (v2) == Array (v)
38
38
39
39
for (attribname,attribval) in v. attrib
@@ -42,18 +42,23 @@ using CommonDataModel: iswritable, attribnames, parentdataset
42
42
end
43
43
44
44
for (attribname,attribval) in ds. attrib
45
- @test ds2 . attrib[attribname] == attribval
45
+ @test dsz . attrib[attribname] == attribval
46
46
end
47
47
48
48
io = IOBuffer ()
49
- show (io,ds )
49
+ show (io,dsz )
50
50
str = String (take! (io))
51
51
@test occursin (" title" ,str)
52
52
53
- @test ! iswritable (ds )
54
- @test " title" in attribnames (ds )
55
- @test isnothing (parentdataset (ds ))
53
+ @test ! iswritable (dsz )
54
+ @test " title" in attribnames (dsz )
55
+ @test isnothing (parentdataset (dsz ))
56
56
57
+ zvar = ZarrDataset (fname) do ds3
58
+ Array (ds3[" var" ])
59
+ end
60
+
61
+ @test zvar == Array (ds[" var" ])
57
62
close (ds)
58
- close (ds2 )
63
+ close (dsz )
59
64
end
0 commit comments