Skip to content

Commit 20dc71a

Browse files
committed
add show variable (wip)
1 parent e73e71d commit 20dc71a

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

src/DistributedFactorGraphs.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ export timestamp # DEPRECATED
2626
export label, getTimestamp, setTimestamp!, tags, setTags!, estimates, estimate, data, softtype, solverData, getData, solverDataDict, setSolverData, setSolverData!, internalId, smallData, setSmallData!, bigData
2727
export DFGVariableSummary, DFGFactorSummary, AbstractDFGSummary
2828
export addBigDataEntry!, getBigDataEntry, updateBigDataEntry!, deleteBigDataEntry!, getBigDataEntries, getBigDataKeys
29+
export showFactor, showVariable
2930

3031
#Skeleton types
3132
export SkeletonDFGVariable, SkeletonDFGFactor

src/services/AbstractDFG.jl

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -646,6 +646,28 @@ Display and return to console the user factor identified by tag name.
646646
showFactor(fgl::G, fsym::Symbol) where G <: AbstractDFG = @show getFactor(fgl,fsym)
647647

648648

649+
# """
650+
# $SIGNATURES
651+
#
652+
# TODO: OLD, NEEDS TO BE REWORKED
653+
# Display the content of `VariableNodeData` to console for a given factor graph and variable tag`::Symbol`.
654+
#
655+
# Dev Notes
656+
# - TODO split as two show macros between AMP and DFG
657+
# """
658+
# function showVariable(fgl::G, vsym::Symbol) where G <: AbstractDFG
659+
# vert = DFG.getVariable(fg, vsym)
660+
# vnd = solverData(vert)
661+
# println("label: $(vert.label), exVertexId: $(vert.index)")
662+
# println("tags: $( haskey(vert.attributes, string(:tags)) ? vert.attributes[string(:tags)] : string(:none))")
663+
# println("size marginal samples $(size(getVal(vnd)))")
664+
# println("kde bandwidths: $(getBW(vnd)[:,1])")
665+
# println("kde mean: $(round.(getKDEMean(getKDE(vnd)),digits=4))")
666+
# println("kde max: $(round.(getKDEMax(getKDE(vnd)),digits=4))")
667+
# println()
668+
# vnd
669+
# end
670+
649671
"""
650672
$(SIGNATURES)
651673
Produces a dot-format of the graph for visualization.

0 commit comments

Comments
 (0)