Skip to content

Commit 625932e

Browse files
all Chunkeds are chunked (#226)
* all `Chunked`s are chunked * add test
1 parent 0e84f14 commit 625932e

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/broadcast.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ end
5757
function common_chunks(s, args...)
5858
N = length(s)
5959
chunkedarrays = reduce(args; init=()) do acc, x
60-
haschunks(x) === Chunked() ? (acc..., x) : acc
60+
haschunks(x) isa Chunked ? (acc..., x) : acc
6161
end
6262
all(ar -> isa(eachchunk(ar), GridChunks), chunkedarrays) ||
6363
error("Currently only chunks of type GridChunks can be merged by broadcast")

test/runtests.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -368,8 +368,10 @@ import Statistics: mean
368368
end
369369

370370
@testset "Broadcast" begin
371-
a_disk1 = AccessCountDiskArray(rand(10, 9, 2); chunksize=(5, 3, 2))
372-
test_broadcast(a_disk1)
371+
for batchstrategy in (DiskArrays.ChunkRead(), DiskArrays.SubRanges())
372+
a_disk1 = AccessCountDiskArray(rand(10, 9, 2); chunksize=(5, 3, 2), batchstrategy)
373+
test_broadcast(a_disk1)
374+
end
373375
end
374376

375377
@testset "zip" begin

0 commit comments

Comments
 (0)