Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: TuringLang/DynamicPPL.jl
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 21889d72aeb1d96246ca9ea176c177ee6fe67089
Choose a base ref
..
head repository: TuringLang/DynamicPPL.jl
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 0d7b2d1e96e0457c98a0887c294d43b80db96ce6
Choose a head ref
Showing with 3 additions and 4 deletions.
  1. +3 −4 test/varinfo.jl
7 changes: 3 additions & 4 deletions test/varinfo.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Dummy algorithm for testing
# Invoke with: DynamicPPL.Sampler(MyAlg{(:x, :y)}(), ...)
struct MyAlg{space} end
DynamicPPL.getspace(::DynamicPPL.Sampler{MyAlg{space}}) where space = space
DynamicPPL.getspace(::DynamicPPL.Sampler{MyAlg{space}}) where {space} = space

function check_varinfo_keys(varinfo, vns)
if varinfo isa DynamicPPL.SimpleOrThreadSafeSimple{<:NamedTuple}
@@ -716,7 +716,7 @@ end
## i.e. `VarName{sym}()` without any indexing, etc.
vns_supported =
if varinfo isa DynamicPPL.SimpleOrThreadSafeSimple &&
values_as(varinfo) isa NamedTuple
values_as(varinfo) isa NamedTuple
vns_supported_simple
else
vns_supported_standard
@@ -891,7 +891,7 @@ end

# Should only get the variables subsumed by `@varname(s)`.
@test varinfo[spl] ==
mapreduce(Base.Fix1(DynamicPPL.getindex_internal, varinfo), vcat, vns_s)
mapreduce(Base.Fix1(DynamicPPL.getindex_internal, varinfo), vcat, vns_s)

# `link`
varinfo_linked = DynamicPPL.link(varinfo, spl, model)
@@ -1097,5 +1097,4 @@ end
test_varinfo!(vi)
test_varinfo!(empty!!(DynamicPPL.TypedVarInfo(vi)))
end

end