Skip to content

Commit 1568d4c

Browse files
fix chunking for multi-file
1 parent 1964a6b commit 1568d4c

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

src/multifile.jl

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -254,13 +254,14 @@ end
254254
255255
Return the storage type (`:contiguous` or `:chunked`) and the chunk sizes of the varable
256256
`v` corresponding to the first file. If the first file in the collection
257-
is chunked then this storage attributes are returns. If not the first file is not contiguous, then multi-file variable is still reported as chunked with chunk size equal to the variable size.
257+
is chunked then this storage attributes are returned. If not the first file is not contiguous, then multi-file variable is still reported as chunked with chunk size equal to the size of the first variable.
258258
"""
259259
function chunking(v::MFVariable)
260-
storage,chunksizes = chunking(v.ds.ds[1][name(v)])
260+
v1 = v.ds.ds[1][name(v)]
261+
storage,chunksizes = chunking(v1)
261262

262-
if chunksizes == :contiguous
263-
return (:chunked, collect(size(v)))
263+
if storage == :contiguous
264+
return (:chunked, size(v1))
264265
else
265266
return storage,chunksizes
266267
end

test/test_multifile.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ mfds.attrib["new"] = "attrib"
195195

196196
@test name(parentdataset(mfds.group["group"])) == "/"
197197

198-
@test chunking(mfds[varname]) == (:contiguous, (2, 3, 3))
198+
@test chunking(mfds[varname]) == (:chunked, (2, 3, 1))
199199
@test deflate(mfds[varname]) == (false, false, 0)
200200
@test checksum(mfds[varname]) == :nochecksum
201201

0 commit comments

Comments
 (0)