Skip to content

Commit 92af231

Browse files
Copilotyebai
andauthored
Improve docstrings for MCMCThreads, MCMCDistributed, and MCMCSerial with usage examples (#171)
* Initial plan * Improve docstrings for MCMCThreads, MCMCDistributed, and MCMCSerial Co-authored-by: yebai <[email protected]> --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: yebai <[email protected]>
1 parent 33fdad8 commit 92af231

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

src/AbstractMCMC.jl

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,14 @@ abstract type AbstractMCMCEnsemble end
6363
6464
The `MCMCThreads` algorithm allows users to sample MCMC chains in parallel using multiple
6565
threads.
66+
67+
# Usage
68+
69+
```julia
70+
sample(model, sampler, MCMCThreads(), N, nchains)
71+
```
72+
73+
See also [`sample`](@ref).
6674
"""
6775
struct MCMCThreads <: AbstractMCMCEnsemble end
6876

@@ -71,13 +79,29 @@ struct MCMCThreads <: AbstractMCMCEnsemble end
7179
7280
The `MCMCDistributed` algorithm allows users to sample MCMC chains in parallel using multiple
7381
processes.
82+
83+
# Usage
84+
85+
```julia
86+
sample(model, sampler, MCMCDistributed(), N, nchains)
87+
```
88+
89+
See also [`sample`](@ref).
7490
"""
7591
struct MCMCDistributed <: AbstractMCMCEnsemble end
7692

7793
"""
7894
MCMCSerial
7995
8096
The `MCMCSerial` algorithm allows users to sample serially, with no thread or process parallelism.
97+
98+
# Usage
99+
100+
```julia
101+
sample(model, sampler, MCMCSerial(), N, nchains)
102+
```
103+
104+
See also [`sample`](@ref).
81105
"""
82106
struct MCMCSerial <: AbstractMCMCEnsemble end
83107

0 commit comments

Comments
 (0)