Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit e75fd1e

Browse files
authoredApr 28, 2025··
Implement missing tilde_assume method (#904)
1 parent 6cd439d commit e75fd1e

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed
 

‎HISTORY.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# DynamicPPL Changelog
22

3+
## 0.36.1
4+
5+
Fixed a missing method for `tilde_assume`.
6+
37
## 0.36.0
48

59
**Breaking changes**

‎Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "DynamicPPL"
22
uuid = "366bfd00-2699-11ea-058f-f148b4cae6d8"
3-
version = "0.36.0"
3+
version = "0.36.1"
44

55
[deps]
66
ADTypes = "47edcb42-4c32-4615-8424-f2b9edc5f35b"

‎src/context_implementations.jl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ function tilde_assume(context::AbstractContext, args...)
5757
return tilde_assume(NodeTrait(tilde_assume, context), context, args...)
5858
end
5959
function tilde_assume(::IsLeaf, context::AbstractContext, right, vn, vi)
60+
# no rng nor sampler
6061
return assume(right, vn, vi)
6162
end
6263
function tilde_assume(::IsParent, context::AbstractContext, args...)
@@ -69,11 +70,17 @@ end
6970
function tilde_assume(
7071
::IsLeaf, rng::Random.AbstractRNG, context::AbstractContext, sampler, right, vn, vi
7172
)
73+
# rng and sampler
7274
return assume(rng, sampler, right, vn, vi)
7375
end
76+
function tilde_assume(::IsLeaf, context::AbstractContext, sampler, right, vn, vi)
77+
# sampler but no rng
78+
return assume(Random.default_rng(), sampler, right, vn, vi)
79+
end
7480
function tilde_assume(
7581
::IsParent, rng::Random.AbstractRNG, context::AbstractContext, args...
7682
)
83+
# rng but no sampler
7784
return tilde_assume(rng, childcontext(context), args...)
7885
end
7986

2 commit comments

Comments
 (2)

penelopeysm commented on Apr 28, 2025

@penelopeysm
MemberAuthor

@JuliaRegistrator register

Release notes:

Fixed a missing method for tilde_assume.

JuliaRegistrator commented on Apr 28, 2025

@JuliaRegistrator

Registration pull request created: JuliaRegistries/General/129924

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.36.1 -m "<description of version>" e75fd1efce9fd558a5d45d8de243d565a9c890b0
git push origin v0.36.1
Please sign in to comment.