Skip to content

Commit 2074657

Browse files
committed
Merge remote-tracking branch 'origin/main' into breaking
2 parents a0289db + ce7c8b1 commit 2074657

File tree

5 files changed

+14
-18
lines changed

5 files changed

+14
-18
lines changed

HISTORY.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,10 @@ And a couple of more internal changes:
7070
- The model evaluation function, `model.f` for some `model::Model`, no longer takes a context as an argument
7171
- The internal representation and API dealing with submodels (i.e., `ReturnedModelWrapper`, `Sampleable`, `should_auto_prefix`, `is_rhs_model`) has been simplified. If you need to check whether something is a submodel, just use `x isa DynamicPPL.Submodel`. Note that the public API i.e. `to_submodel` remains completely untouched.
7272

73+
## 0.36.15
74+
75+
Bumped minimum Julia version to 1.10.8 to avoid potential crashes with `Core.Compiler.widenconst` (which Mooncake uses).
76+
7377
## 0.36.14
7478

7579
Added compatibility with [email protected].

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,4 +74,4 @@ Random = "1.6"
7474
Requires = "1"
7575
Statistics = "1"
7676
Test = "1.6"
77-
julia = "1.10"
77+
julia = "1.10.8"

src/test_utils/models.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ A model with variables `m` and `x` with `x` having support depending on `m`.
1414
"""
1515
@model function demo_dynamic_constraint()
1616
m ~ Normal()
17-
x ~ truncated(Normal(), m, Inf)
17+
x ~ truncated(Normal(); lower=m)
1818

1919
return (m=m, x=x)
2020
end
2121
function logprior_true(model::Model{typeof(demo_dynamic_constraint)}, m, x)
22-
return logpdf(Normal(), m) + logpdf(truncated(Normal(), m, Inf), x)
22+
return logpdf(Normal(), m) + logpdf(truncated(Normal(); lower=m), x)
2323
end
2424
function loglikelihood_true(model::Model{typeof(demo_dynamic_constraint)}, m, x)
2525
return zero(float(eltype(m)))
@@ -30,7 +30,7 @@ end
3030
function logprior_true_with_logabsdet_jacobian(
3131
model::Model{typeof(demo_dynamic_constraint)}, m, x
3232
)
33-
b_x = Bijectors.bijector(truncated(Normal(), m, Inf))
33+
b_x = Bijectors.bijector(truncated(Normal(); lower=m))
3434
x_unconstrained, Δlogp = Bijectors.with_logabsdet_jacobian(b_x, x)
3535
return (m=m, x=x_unconstrained), logprior_true(model, m, x) - Δlogp
3636
end

test/compiler.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,7 @@ module Issue537 end
498498
@model function demo(y)
499499
α ~ Uniform()
500500
μ ~ Normal()
501-
σ ~ truncated(Normal(), 0, Inf)
501+
σ ~ truncated(Normal(); lower=0)
502502
num_steps = length(y[1])
503503
num_obs = length(y)
504504
@inbounds for i in 1:num_obs

test/varinfo.jl

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -67,16 +67,8 @@ end
6767

6868
@testset "Base" begin
6969
# Test Base functions:
70-
# string, Symbol, ==, hash, in, keys, haskey, isempty, push!!, empty!!,
70+
# in, keys, haskey, isempty, push!!, empty!!,
7171
# getindex, setindex!, getproperty, setproperty!
72-
csym = gensym()
73-
vn1 = @varname x[1][2]
74-
@test string(vn1) == "x[1][2]"
75-
@test Symbol(vn1) == Symbol("x[1][2]")
76-
77-
vn2 = @varname x[1][2]
78-
@test vn2 == vn1
79-
@test hash(vn2) == hash(vn1)
8072

8173
function test_base(vi_original)
8274
vi = deepcopy(vi_original)
@@ -289,14 +281,14 @@ end
289281
@testset "setval! & setval_and_resample!" begin
290282
@model function testmodel(x)
291283
n = length(x)
292-
s ~ truncated(Normal(), 0, Inf)
284+
s ~ truncated(Normal(); lower=0)
293285
m ~ MvNormal(zeros(n), I)
294286
return x ~ MvNormal(m, s^2 * I)
295287
end
296288

297289
@model function testmodel_univariate(x, ::Type{TV}=Vector{Float64}) where {TV}
298290
n = length(x)
299-
s ~ truncated(Normal(), 0, Inf)
291+
s ~ truncated(Normal(); lower=0)
300292

301293
m = TV(undef, n)
302294
for i in eachindex(m)
@@ -561,10 +553,10 @@ end
561553
end
562554

563555
@testset "istrans" begin
564-
@model demo_constrained() = x ~ truncated(Normal(), 0, Inf)
556+
@model demo_constrained() = x ~ truncated(Normal(); lower=0)
565557
model = demo_constrained()
566558
vn = @varname(x)
567-
dist = truncated(Normal(), 0, Inf)
559+
dist = truncated(Normal(); lower=0)
568560

569561
### `VarInfo`
570562
# Need to run once since we can't specify that we want to _sample_

0 commit comments

Comments
 (0)