Skip to content

Commit 9aba468

Browse files
committed
Fix doctests
1 parent 59f67fd commit 9aba468

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

src/varnamedtuple.jl

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,10 @@ Create a new `PartialArray`.
126126
The element type and number of dimensions have to be specified explicitly as type
127127
parameters. The positional arguments can be `Pair`s of indices and values. For example,
128128
```jldoctest
129+
julia> using DynamicPPL.VarNamedTuples: PartialArray
130+
129131
julia> pa = PartialArray{Int,2}((1,2) => 5, (3,4) => 10)
130-
PartialArray{Int,2}((1, 2) => 5, (3, 4) => 10)
132+
PartialArray{Int64,2}((1, 2) => 5, (3, 4) => 10)
131133
```
132134
133135
The optional keywoard argument `min_size` can be used to specify the minimum initial size.
@@ -580,14 +582,18 @@ end
580582
Apply `func` to the subdata at `name` in `vnt`, and set the result back at `name`.
581583
582584
```jldoctest
585+
julia> using DynamicPPL: VarNamedTuple, setindex!!
586+
587+
julia> using DynamicPPL.VarNamedTuples: apply!!
588+
583589
julia> vnt = VarNamedTuple()
584-
()
590+
VarNamedTuple()
585591
586592
julia> vnt = setindex!!(vnt, [1, 2, 3], @varname(a))
587-
(a -> [1, 2, 3])
593+
VarNamedTuple(a = [1, 2, 3],)
588594
589-
julia> VarNamedTuples.apply!!(x -> x .+ 1, vnt, @varname(a))
590-
(a -> [2, 3, 4])
595+
julia> apply!!(x -> x .+ 1, vnt, @varname(a))
596+
VarNamedTuple(a = [2, 3, 4],)
591597
```
592598
"""
593599
function apply!!(func, vnt::VarNamedTuple, name::VarName)

0 commit comments

Comments
 (0)