Skip to content

Commit 02280e1

Browse files
committed
something is better than nothing
1 parent d13883d commit 02280e1

File tree

2 files changed

+34
-31
lines changed

2 files changed

+34
-31
lines changed

src/needsahome.jl

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,40 @@ function buildSubgraphFromLabels(dfg::G,
7171
buildSubgraphFromLabels!(dfg, syms, subfg=subfg, solvable=solvable, allowedFactors=allowedFactors )
7272
end
7373

74+
"""
75+
$SIGNATURES
76+
77+
Display and return to console the user factor identified by tag name.
78+
"""
79+
printFactor(fgl::AbstractDFG, fsym::Symbol) = @show getFactor(fgl,fsym)
80+
81+
82+
"""
83+
$SIGNATURES
84+
85+
Display the content of `VariableNodeData` to console for a given factor graph and variable tag`::Symbol`.
86+
87+
Dev Notes
88+
- TODO split as two show macros between AMP and DFG
89+
"""
90+
function printVariable(fgl::AbstractDFG, vsym::Symbol, solveKey::Symbol=:default)
91+
vert = getVariable(fgl, vsym)
92+
vnd = solverData(vert, solveKey)
93+
println("label: $(vert.label)")
94+
println("tags: $(getTags(vert))")
95+
println("size marginal samples $(size(vnd.val))")
96+
println("kde bandwidths: $((vnd.bw)[:,1])")
97+
if 0 < length(getVariablePPEs(vert))
98+
println("PPE.suggested: $(round.(getVariablePPE(vert).suggested,digits=4))")
99+
else
100+
println("No PPEs")
101+
end
102+
# println("kde max: $(round.(getKDEMax(getKDE(vnd)),digits=4))")
103+
# println("kde max: $(round.(getKDEMax(getKDE(vnd)),digits=4))")
104+
println()
105+
vnd
106+
end
107+
74108

75109
## KEEPING COMMENT, WANT TO BE CONSOLIDATED WITH FUNCTION ABOVE -- KEEPING ONLY ONE FOR MAINTAINABILITY
76110
## STILL NEEDS TO BE CONSOLIDATED WITH `DFG._copyIntoGraph`

src/services/AbstractDFG.jl

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -674,37 +674,6 @@ function getFactorFunction(dfg::G, fsym::Symbol) where G <: AbstractDFG
674674
end
675675

676676

677-
"""
678-
$SIGNATURES
679-
680-
Display and return to console the user factor identified by tag name.
681-
"""
682-
showFactor(fgl::G, fsym::Symbol) where G <: AbstractDFG = @show getFactor(fgl,fsym)
683-
684-
685-
"""
686-
$SIGNATURES
687-
688-
TODO: OLD, NEEDS TO BE REWORKED
689-
Display the content of `VariableNodeData` to console for a given factor graph and variable tag`::Symbol`.
690-
691-
Dev Notes
692-
- TODO split as two show macros between AMP and DFG
693-
"""
694-
function printVariable(fgl::AbstractDFG, vsym::Symbol)
695-
vert = getVariable(fgl, vsym)
696-
vnd = solverData(vert)
697-
println("label: $(vert.label)")
698-
println("tags: $(getTags(vert))")
699-
println("size marginal samples $(size(getVal(vnd)))")
700-
println("kde bandwidths: $(getBW(vnd)[:,1])")
701-
println("PPE.suggested: $(round.(getVariablePPE(vnd).suggested,digits=4))")
702-
# println("kde max: $(round.(getKDEMax(getKDE(vnd)),digits=4))")
703-
# println("kde max: $(round.(getKDEMax(getKDE(vnd)),digits=4))")
704-
println()
705-
vnd
706-
end
707-
708677
"""
709678
$(SIGNATURES)
710679
Produces a dot-format of the graph for visualization.

0 commit comments

Comments
 (0)