Skip to content

Commit

Permalink
Fix missing variable
Browse files Browse the repository at this point in the history
  • Loading branch information
penelopeysm committed Dec 4, 2024
1 parent 126ae32 commit 37c8f53
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions test/model.jl
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,11 @@ is_typed_varinfo(::DynamicPPL.AbstractVarInfo) = false
is_typed_varinfo(varinfo::DynamicPPL.TypedVarInfo) = true
is_typed_varinfo(varinfo::DynamicPPL.SimpleVarInfo{<:NamedTuple}) = true

const GDEMO_DEFAULT = DynamicPPL.TestUtils.demo_assume_observe_literal

@testset "model.jl" begin
@testset "convenience functions" begin
model = gdemo_default # defined in test/test_util.jl
model = GDEMO_DEFAULT # defined in test/test_util.jl

# sample from model and extract variables
vi = VarInfo(model)
Expand Down Expand Up @@ -97,7 +99,7 @@ is_typed_varinfo(varinfo::DynamicPPL.SimpleVarInfo{<:NamedTuple}) = true
end

@testset "rng" begin
model = gdemo_default
model = GDEMO_DEFAULT

for sampler in (SampleFromPrior(), SampleFromUniform())
for i in 1:10
Expand All @@ -115,7 +117,7 @@ is_typed_varinfo(varinfo::DynamicPPL.SimpleVarInfo{<:NamedTuple}) = true
end

@testset "defaults without VarInfo, Sampler, and Context" begin
model = gdemo_default
model = GDEMO_DEFAULT

Random.seed!(100)
s, m = model()
Expand Down Expand Up @@ -155,7 +157,7 @@ is_typed_varinfo(varinfo::DynamicPPL.SimpleVarInfo{<:NamedTuple}) = true
end

@testset "Internal methods" begin
model = gdemo_default
model = GDEMO_DEFAULT

# sample from model and extract variables
vi = VarInfo(model)
Expand Down Expand Up @@ -195,7 +197,7 @@ is_typed_varinfo(varinfo::DynamicPPL.SimpleVarInfo{<:NamedTuple}) = true
end

@testset "rand" begin
model = gdemo_default
model = GDEMO_DEFAULT

Random.seed!(1776)
s, m = model()
Expand Down

0 comments on commit 37c8f53

Please sign in to comment.