Skip to content

Commit

Permalink
Simplify is_target_varname
Browse files Browse the repository at this point in the history
  • Loading branch information
mhauru committed Nov 29, 2024
1 parent 2025ef9 commit 38ac128
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/mcmc/gibbs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,7 @@ function get_conditioned_gibbs(context::GibbsContext, vns::AbstractArray{<:VarNa
return map(Base.Fix1(get_conditioned_gibbs, context), vns)
end

function is_target_varname(context::GibbsContext, vn::VarName)
return is_target_varname(context, DynamicPPL.getsym(vn))
end

is_target_varname(::GibbsContext{T}, vn_symbol::Symbol) where {T} = vn_symbol in T
is_target_varname(::GibbsContext{VNs}, ::VarName{sym}) where {VNs,sym} = sym in VNs

function is_target_varname(context::GibbsContext, vns::AbstractArray{<:VarName})
num_target = count(Iterators.map(Base.Fix1(is_target_varname, context), vns))
Expand Down

0 comments on commit 38ac128

Please sign in to comment.