Skip to content

Commit 33b36f8

Browse files
committed
Fix rand sampler syntx
1 parent 3414f6a commit 33b36f8

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

docs/src/utils.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ There are also methods for random sampling of nodes:
2626

2727
```@docs
2828
NodeSampler
29-
rand(rng::AbstractRNG, tree::AbstractNode; break_sharing::Val=Val(false))
29+
rand(rng::AbstractRNG, tree::AbstractNode)
3030
rand(rng::AbstractRNG, sampler::NodeSampler{N,F,Nothing}) where {N,F}
3131
```
3232

src/Random.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ nodes on which to sample.
1717
nodes are sampled uniformly. For a `GraphNode`, nodes are also
1818
sampled uniformly (e.g., in `sin(x) + {x}`, the `x` has equal
1919
probability of being sampled from the `sin` or the `+` node, because
20-
it is shared), unless `break_sharing` is set to `true` or `Val(true)`.
20+
it is shared), unless `break_sharing` is set to `Val(true)`.
2121
- `filter::Function`: A function that takes a node and returns a boolean
2222
indicating whether the node should be sampled. Defaults to `Returns(true)`.
2323
- `weighting::Union{Nothing,Function}`: A function that takes a node and
@@ -38,11 +38,11 @@ Base.@kwdef struct NodeSampler{
3838
end
3939

4040
"""
41-
rand(rng::AbstractRNG, tree::AbstractNode; break_sharing::Val=Val(false))
41+
rand(rng::AbstractRNG, tree::AbstractNode)
4242
43-
Sample a node from a tree according to the default sampler `NodeSampler(; tree, break_sharing)`.
43+
Sample a node from a tree according to the default sampler `NodeSampler(; tree)`.
4444
"""
45-
rand(rng::AbstractRNG, tree::AbstractNode; break_sharing::Val=Val(false)) = rand(rng, NodeSampler(; tree, break_sharing))
45+
rand(rng::AbstractRNG, tree::AbstractNode) = rand(rng, NodeSampler(; tree))
4646

4747
"""
4848
rand(rng::AbstractRNG, sampler::NodeSampler)

0 commit comments

Comments
 (0)