Skip to content

Commit 83ff31d

Browse files
committed
Add docs
1 parent 61d60a1 commit 83ff31d

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/AbstractChains.jl

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,21 @@ matrices of values.
1212
Note that, despite its name, an `AbstractChain` can store multiple chains (e.g. when
1313
sampling in parallel, or when combining chains from multiple runs). The main reason why this
1414
needs to be a singular form is because the package name is already AbstractChains (plural).
15+
16+
## Interface
17+
18+
To implement a new subtype of `AbstractChain`, you need to define the following methods:
19+
20+
- `Base.size` should return a tuple of ints (the exact meaning is left to you)
21+
- `Base.keys` should return a list of keys
22+
- [`AbstractChains.get_data`](@ref)`(chn, key)`
23+
- [`AbstractChains.iter_indices`](@ref)`(chn)`
24+
- [`AbstractChains.chain_indices`](@ref)`(chn)`
25+
26+
You can optionally define the following methods for efficiency:
27+
28+
- [`AbstractChains.niters`](@ref)`(chn)`
29+
- [`AbstractChains.nchains`](@ref)`(chn)`
1530
"""
1631
abstract type AbstractChain end
1732

0 commit comments

Comments
 (0)