Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "DiskArrays"
uuid = "3c3547ce-8d99-4f5e-a174-61eb10b00ae3"
authors = ["Fabian Gans <fgans@bgc-jena.mpg.de>"]
version = "0.4.19"
version = "0.4.20"

[deps]
ConstructionBase = "187b0558-2788-49d3-abe0-74a17ed4e7c9"
Expand Down
2 changes: 2 additions & 0 deletions src/iterator.jl
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ end
end
end
end
_iterate_disk(a::AbstractArray{<:Any,0}, i=1) = i == 1 ? (@inbounds a[i], 2) : nothing

@noinline function _iterate_disk(a)
# Get the indices for each chunk of data
blockinds = BlockedIndices(eachchunk(a))
Expand Down
9 changes: 9 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,15 @@ end
end
end

# https://github.com/JuliaIO/DiskArrays.jl/issues/289
@testset "iteration works for 0-dimensional arrays" begin
a = UnchunkedDiskArray(fill(42))
@test iterate(a) == (42, 2)
@test iterate(a, 1) == (42, 2)
@test iterate(a, 2) === nothing
@test collect(a) == fill(42)
end

@testset "Views" begin
a = AccessCountDiskArray(zeros(Int, 4, 5, 1))
test_view(a)
Expand Down
Loading