Skip to content

Commit 0ff255d

Browse files
authored
Document the Storage API in a docstring on AbstractStore (#151)
* Document the Storage API in a docstring on AbstractStore We should also put this in the docs, but it's probably a start on what has to happen. Would appreciate reviews/corrections to this since this is only what I could find when skimming the code. * Push preview docs too
1 parent c434916 commit 0ff255d

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

docs/make.jl

+1
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,5 @@ isdir(zarrpath) && rm(zarrpath, recursive=true)
2323

2424
deploydocs(
2525
repo = "github.com/JuliaIO/Zarr.jl.git",
26+
push_preview = true,
2627
)

src/Storage/Storage.jl

+23
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,29 @@
11

22
# Defines different storages for zarr arrays. Currently only regular files (DirectoryStore)
33
# and Dictionaries are supported
4+
5+
"""
6+
abstract type AbstractStore
7+
8+
This the abstract supertype for all Zarr store implementations. Currently only regular files ([`DirectoryStore`](@ref))
9+
and Dictionaries are supported.
10+
11+
## Interface
12+
13+
All subtypes of `AbstractStore` must implement the following methods:
14+
15+
- [`storagesize(d::AbstractStore, p::AbstractString)`](@ref storagesize)
16+
- [`subdirs(d::AbstractStore, p::AbstractString)`](@ref subdirs)
17+
- [`subkeys(d::AbstractStore, p::AbstractString)`](@ref subkeys)
18+
- [`isinitialized(d::AbstractStore, p::AbstractString)`](@ref isinitialized)
19+
- [`storefromstring(::Type{<: AbstractStore}, s, _)`](@ref storefromstring)
20+
- `Base.getindex(d::AbstractStore, i::AbstractString)`: return the data stored in key `i` as a Vector{UInt8}
21+
- `Base.setindex!(d::AbstractStore, v, i::AbstractString)`: write the values in `v` to the key `i` of the given store `d`
22+
23+
They may optionally implement the following methods:
24+
25+
- [`store_read_strategy(s::AbstractStore)`](@ref store_read_strategy): return the read strategy for the given store. See [`SequentialRead`](@ref) and [`ConcurrentRead`](@ref).
26+
"""
427
abstract type AbstractStore end
528

629
#Define the interface

0 commit comments

Comments
 (0)