Skip to content

Commit

Permalink
show subarrays/groups up to 10
Browse files Browse the repository at this point in the history
  • Loading branch information
bicycle1885 committed Aug 22, 2024
1 parent 275846c commit 9849bbc
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion src/ZGroup.jl
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,22 @@ function zopen_noerr(s::AbstractStore, mode="r";
end
end

Base.show(io::IO, g::ZGroup) = print(io, "ZarrGroup at ", g.storage, " and path ", g.path)
function Base.show(io::IO, g::ZGroup)
print(io, "ZarrGroup at ", g.storage, " and path ", g.path)
for (i, d) in enumerate(subdirs(g.storage, g.path))
if i > 10 # don't print too many
print(io, "\n ...")
break

Check warning on line 52 in src/ZGroup.jl

View check run for this annotation

Codecov / codecov/patch

src/ZGroup.jl#L49-L52

Added lines #L49 - L52 were not covered by tests
end
path = _concatpath(g.path, d)
if is_zarray(g.storage, path)
print(io, "\n ", d, " (Array)")
elseif is_zgroup(g.storage, path)
print(io, "\n ", d, " (Group)")

Check warning on line 58 in src/ZGroup.jl

View check run for this annotation

Codecov / codecov/patch

src/ZGroup.jl#L54-L58

Added lines #L54 - L58 were not covered by tests
end
end

Check warning on line 60 in src/ZGroup.jl

View check run for this annotation

Codecov / codecov/patch

src/ZGroup.jl#L60

Added line #L60 was not covered by tests
end

function Base.haskey(g::ZGroup, k)
path = _concatpath(g.path, k)
is_zarray(g.storage, path) || is_zgroup(g.storage, path)

Check warning on line 65 in src/ZGroup.jl

View check run for this annotation

Codecov / codecov/patch

src/ZGroup.jl#L63-L65

Added lines #L63 - L65 were not covered by tests
Expand Down

0 comments on commit 9849bbc

Please sign in to comment.