============================ UNTYPED ============================
# DISPLAY
/=======================================================================
| VarInfo
|-----------------------------------------------------------------------
| Varnames : AbstractPPL.VarName[x, y]
| Range : UnitRange{Int64}[1:1, 2:3]
| Vals : Real[0.6393339904991309, -2.1020960714862715, 0.21204297326010874]
| Orders : [0, 0]
| Logp : -6.004814519363116
| #produce : 0
| flags : Dict{String, BitVector}("del" => [0, 0], "trans" => [0, 0])
\=======================================================================
# SHOW
VarInfo (2 variables (y, x), dimension 3; logp: -6.005)
============================ TYPED ============================
# DISPLAY
DynamicPPL.TypedVarInfo{@NamedTuple{x::DynamicPPL.Metadata{Dict{AbstractPPL.VarName{:x, typeof(identity)}, Int64}, Vector{Distributions.Normal{Float64}}, Vector{AbstractPPL.VarName{:x, typeof(identity)}}, Vector{Float64}}, y::DynamicPPL.Metadata{Dict{AbstractPPL.VarName{:y, typeof(identity)}, Int64}, Vector{Distributions.ZeroMeanDiagNormal{Tuple{Base.OneTo{Int64}}}}, Vector{AbstractPPL.VarName{:y, typeof(identity)}}, Vector{Float64}}}, Float64}((x = DynamicPPL.Metadata{Dict{AbstractPPL.VarName{:x, typeof(identity)}, Int64}, Vector{Distributions.Normal{Float64}}, Vector{AbstractPPL.VarName{:x, typeof(identity)}}, Vector{Float64}}(Dict(x => 1), [x], UnitRange{Int64}[1:1], [-1.250616290583678], Distributions.Normal{Float64}[Distributions.Normal{Float64}(μ=0.0, σ=1.0)], [0], Dict{String, BitVector}("del" => [0], "trans" => [0])), y = DynamicPPL.Metadata{Dict{AbstractPPL.VarName{:y, typeof(identity)}, Int64}, Vector{Distributions.ZeroMeanDiagNormal{Tuple{Base.OneTo{Int64}}}}, Vector{AbstractPPL.VarName{:y, typeof(identity)}}, Vector{Float64}}(Dict(y => 1), [y], UnitRange{Int64}[1:2], [0.7503094371292123, 0.3255295112123813], Distributions.ZeroMeanDiagNormal{Tuple{Base.OneTo{Int64}}}[ZeroMeanDiagNormal(
dim: 2
μ: Zeros(2)
Σ: [1.250616290583678 0.0; 0.0 1.250616290583678]
)
], [0], Dict{String, BitVector}("del" => [0], "trans" => [0]))), Base.RefValue{Float64}(-4.029914243271634), Base.RefValue{Int64}(0))
# SHOW
DynamicPPL.TypedVarInfo{@NamedTuple{x::DynamicPPL.Metadata{Dict{AbstractPPL.VarName{:x, typeof(identity)}, Int64}, Vector{Distributions.Normal{Float64}}, Vector{AbstractPPL.VarName{:x, typeof(identity)}}, Vector{Float64}}, y::DynamicPPL.Metadata{Dict{AbstractPPL.VarName{:y, typeof(identity)}, Int64}, Vector{Distributions.ZeroMeanDiagNormal{Tuple{Base.OneTo{Int64}}}}, Vector{AbstractPPL.VarName{:y, typeof(identity)}}, Vector{Float64}}}, Float64}((x = DynamicPPL.Metadata{Dict{AbstractPPL.VarName{:x, typeof(identity)}, Int64}, Vector{Distributions.Normal{Float64}}, Vector{AbstractPPL.VarName{:x, typeof(identity)}}, Vector{Float64}}(Dict(x => 1), [x], UnitRange{Int64}[1:1], [-1.250616290583678], Distributions.Normal{Float64}[Distributions.Normal{Float64}(μ=0.0, σ=1.0)], [0], Dict{String, BitVector}("del" => [0], "trans" => [0])), y = DynamicPPL.Metadata{Dict{AbstractPPL.VarName{:y, typeof(identity)}, Int64}, Vector{Distributions.ZeroMeanDiagNormal{Tuple{Base.OneTo{Int64}}}}, Vector{AbstractPPL.VarName{:y, typeof(identity)}}, Vector{Float64}}(Dict(y => 1), [y], UnitRange{Int64}[1:2], [0.7503094371292123, 0.3255295112123813], Distributions.ZeroMeanDiagNormal{Tuple{Base.OneTo{Int64}}}[ZeroMeanDiagNormal(
dim: 2
μ: Zeros(2)
Σ: [1.250616290583678 0.0; 0.0 1.250616290583678]
)
], [0], Dict{String, BitVector}("del" => [0], "trans" => [0]))), Base.RefValue{Float64}(-4.029914243271634), Base.RefValue{Int64}(0))
============================ SIMPLE ============================
# DISPLAY
SimpleVarInfo((x = 0.15360503384997595, y = [-0.023559980538471543, 0.19884647851374856]), -1.0257554501131314)
# SHOW
DynamicPPL.SimpleVarInfo{@NamedTuple{x::Float64, y::Vector{Float64}}, Float64, DynamicPPL.NoTransformation}((x = 0.15360503384997595, y = [-0.023559980538471543, 0.19884647851374856]), -1.0257554501131314, DynamicPPL.NoTransformation())
============================ THREADSAFE UNTYPED ============================
# DISPLAY
DynamicPPL.ThreadSafeVarInfo{DynamicPPL.UntypedVarInfo{DynamicPPL.Metadata{Dict{AbstractPPL.VarName, Int64}, Vector{Distributions.Distribution}, Vector{AbstractPPL.VarName}, Vector{Real}}, Float64}, Vector{Base.RefValue{Float64}}}(VarInfo (2 variables (y, x), dimension 3; logp: -3.004), Base.RefValue{Float64}[Base.RefValue{Float64}(0.0)])
# SHOW
DynamicPPL.ThreadSafeVarInfo{DynamicPPL.UntypedVarInfo{DynamicPPL.Metadata{Dict{AbstractPPL.VarName, Int64}, Vector{Distributions.Distribution}, Vector{AbstractPPL.VarName}, Vector{Real}}, Float64}, Vector{Base.RefValue{Float64}}}(VarInfo (2 variables (y, x), dimension 3; logp: -3.004), Base.RefValue{Float64}[Base.RefValue{Float64}(0.0)])Main.MWE
Our current use of
showforVarInfois quite inconsistent. In:Out:
Note that
displayresults in a call toshow(io, ::MIME"text/plain", vi), which is meant to produce a nice, human-readable output.showon the other hand goes toshow(io, vi), which should produce something that includes full details about the object, enough to reconstruct it, preferably as valid Julia code.Two things should be fixed:
UntypedVarInfo, i.e.show(vi)is not a dump ofvias valid code.displayfor the pretty print.TypedVarInfoandThreadSafeVarInfojust fall back toshow(vi)which is not very readable.SimpleVarInfoandUntypedVarInfoboth do have nice print outs, though they are quite different.This issue supersedes #243.