diff --git a/src/logdensityfunction.jl b/src/logdensityfunction.jl index 8b6c1769b..7e2c42673 100644 --- a/src/logdensityfunction.jl +++ b/src/logdensityfunction.jl @@ -63,24 +63,20 @@ function LogDensityFunction( return LogDensityFunction(varinfo, model, SamplingContext(sampler, context)) end -function LogDensityFunction( - model::Model, - context::Union{Nothing,AbstractContext}=nothing, -) +function LogDensityFunction(model::Model, context::Union{Nothing,AbstractContext}=nothing) # Determine the suitable varinfo for the given model and context. - varinfo = determine_suitable_varinfo(model, context === nothing ? leafcontext(model.context) : context) + varinfo = determine_suitable_varinfo( + model, context === nothing ? leafcontext(model.context) : context + ) return LogDensityFunction(varinfo, model, context) end function LogDensityFunction( - model::Model, - varinfo::AbstractVarInfo, - context::Union{Nothing,AbstractContext}=nothing, + model::Model, varinfo::AbstractVarInfo, context::Union{Nothing,AbstractContext}=nothing ) return LogDensityFunction(varinfo, model, context) end - # If a `context` has been specified, we use that. Otherwise we just use the leaf context of `model`. function getcontext(f::LogDensityFunction) return f.context === nothing ? leafcontext(f.model.context) : f.context