Skip to content

Commit 1382054

Browse files
committed
fix doctest error
1 parent c28a75a commit 1382054

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

src/gibbs.jl

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,13 @@ Flatten all the values in the trace into a single vector.
4949
5050
```jldoctest; setup = :(using AbstractMCMC: flatten)
5151
julia> flatten((a=[1,2], b=[3,4,5]))
52-
[1, 2, 3, 4, 5]
52+
5-element Vector{Int64}:
53+
1
54+
2
55+
3
56+
4
57+
5
5358
54-
julia> flatten(OrderedCollections.OrderedDict(:x=>[1.0,2.0], :y=>[3.0,4.0,5.0]))
55-
[1.0, 2.0, 3.0, 4.0, 5.0]
5659
```
5760
"""
5861
function flatten(trace::NamedTuple)
@@ -68,10 +71,10 @@ Reverse operation of flatten. Reshape the vector into the original arrays using
6871
6972
```jldoctest; setup = :(using AbstractMCMC: unflatten)
7073
julia> unflatten([1,2,3,4,5], (a=(2,), b=(3,)))
71-
(a=[1,2], b=[3,4,5])
74+
(a = [1, 2], b = [3, 4, 5])
7275
7376
julia> unflatten([1.0,2.0,3.0,4.0,5.0,6.0], (x=(2,2), y=(2,)))
74-
(x=[1.0 3.0; 2.0 4.0], y=[5.0,6.0])
77+
(x = [1.0 3.0; 2.0 4.0], y = [5.0, 6.0])
7578
```
7679
"""
7780
function unflatten(vec::AbstractVector, variable_sizes::NamedTuple)

0 commit comments

Comments
 (0)