From c20ede362b29328d543131abfd7007372aed62a5 Mon Sep 17 00:00:00 2001 From: Tor Erlend Fjelde Date: Fri, 29 Nov 2024 10:05:48 +0100 Subject: [PATCH] formatting --- src/logdensityfunction.jl | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) 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