Skip to content

Commit a1cfcf4

Browse files
authored
Update for removed deprecations from DFG v0.29 (#1900)
1 parent f6061a1 commit a1cfcf4

5 files changed

Lines changed: 11 additions & 18 deletions

File tree

IncrementalInference/src/ExportAPI.jl

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,17 @@ export AbstractDFG,
1919
getSolvedCount,
2020
isSolved,
2121
setSolvedCount!,
22-
listSupersolves,
2322
listStates,
2423
diagm,
2524
listBlobEntries,
2625
FolderStore,
2726
addBlobstore!,
2827
addData!,
2928
addBlob!,
30-
getData,
3129
VariableCompute,
3230
VariableSummary,
3331
FactorCompute,
34-
DFGFactorSummary,
32+
FactorSummary,
3533
deleteVariableSolverData!
3634
# listDataBlobs # ERROR: LightDFG{} doesn't override 'listDataBlobs'.
3735

IncrementalInference/src/IncrementalInference.jl

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,6 @@ import DistributedFactorGraphs: isSolvable
124124

125125
# TODO using all interal functions of DFG as a transition step, remove true
126126
DFG.@usingDFG true
127-
# TODO remove these deprecated functions/types from DFG
128-
using DistributedFactorGraphs: AbstractRelativeMinimize, AbstractManifoldMinimize
129127

130128
# must be moved to their own repos
131129
const KDE = KernelDensityEstimate
@@ -156,8 +154,9 @@ include("ExportAPI.jl")
156154
## =============================
157155
# Source code
158156

159-
# FIXME, move up to DFG
160-
# abstract type AbstractManifoldMinimize <: AbstractRelativeObservation end
157+
# TODO deprecate, moved here from DFG, replace with traits
158+
abstract type AbstractRelativeMinimize <: RelativeObservation end
159+
abstract type AbstractManifoldMinimize <: RelativeObservation end
161160

162161
# regular
163162

IncrementalInference/src/services/FGOSUtils.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@ end
437437
Fetch and unpack JSON dictionary stored as a data blob.
438438
"""
439439
function fetchDataJSON(dfg::AbstractDFG, varsym::Symbol, lbl::Symbol)
440-
gde, rawData = getData(dfg, varsym, lbl)
440+
gde, rawData = DFG.loadBlob_Variable(dfg, varsym, lbl)
441441
if gde.mimeType == "application/json/octet-stream"
442442
JSON3.read(IOBuffer(rawData))
443443
else

IncrementalInference/src/services/TreeMessageUtils.jl

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -163,16 +163,12 @@ function _findSubgraphsFactorType(
163163
# search connectivity throughout remaining variables, some duplicate computation occurring
164164
for key2 in setdiff(keys(sepsCount), keys(subClassify))
165165
defaultFct = selectFactorType(dfg_, key1, key2)
166-
# @show key1, key2, defaultFct
167-
# TODO validate getfield Main here
168-
# resname = defaultFct isa UnionAll ? getfield(Main, defaultFct.body.name |> Symbol) : defaultFct
169-
resname =
170-
defaultFct isa UnionAll ? getfield(Main, nameof(defaultFct.body)) : defaultFct
166+
171167
pth = findShortestPathDijkstra(
172168
dfg_,
173169
key1,
174170
key2;
175-
typeFactors = [resname;],
171+
typeFilterFactors = x -> x <: defaultFct,
176172
initialized = true,
177173
)
178174
# check if connected to existing subClass

IncrementalInference/test/testJointEnforcement.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,11 @@ tp2_ = [ :x0;:x0x3f1;:x3;:x2x3f1;:x2]
4646
pth = findShortestPathDijkstra(fg, :x0, :x2)
4747
@test pth == tp1_ || pth == tp2_
4848

49-
pth = findShortestPathDijkstra(fg, :x0, :x2, typeFactors=[LinearRelative;])
49+
pth = findShortestPathDijkstra(fg, :x0, :x2, typeFilterFactors = x -> x <: LinearRelative)
5050
@test pth == tp1_
5151

5252
# different path
53-
pth = findShortestPathDijkstra(fg, :x0, :x2, typeFactors=[EuclidDistance;])
53+
pth = findShortestPathDijkstra(fg, :x0, :x2, typeFilterFactors = x -> x <: EuclidDistance)
5454
@test pth == tp2_
5555

5656

@@ -160,11 +160,11 @@ tp2_ = [ :x0;:x0x3f1;:x3;:x2x3f1;:x2]
160160
pth = findShortestPathDijkstra(fg, :x0, :x2)
161161
@test pth == tp1_ || pth == tp2_
162162

163-
pth = findShortestPathDijkstra(fg, :x0, :x2, typeFactors=[LinearRelative;])
163+
pth = findShortestPathDijkstra(fg, :x0, :x2, typeFilterFactors = x -> x <: LinearRelative)
164164
@test pth == tp1_ || pth == tp2_
165165

166166
# different path
167-
pth = findShortestPathDijkstra(fg, :x0, :x2, typeFactors=[EuclidDistance;])
167+
pth = findShortestPathDijkstra(fg, :x0, :x2, typeFilterFactors = x -> x <: EuclidDistance)
168168
@test pth == Symbol[]
169169

170170

0 commit comments

Comments
 (0)