Skip to content

Commit c777d34

Browse files
committed
Update deprecated functions
1 parent 7594782 commit c777d34

File tree

12 files changed

+86
-84
lines changed

12 files changed

+86
-84
lines changed

src/DataBlobs/services/BlobEntry.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ function gatherBlobentries(
306306
labelFilter = variableLabelFilter,
307307
)
308308
return map(vls) do vl
309-
return vl => getBlobentries(dfg, vl; labelFilter, blobIdFilter)
309+
return vl => getVariableBlobentries(dfg, vl; labelFilter, blobIdFilter)
310310
end
311311
end
312312
const collectBlobentries = gatherBlobentries

src/DataBlobs/services/BlobWrappers.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ function loadBlob_Variable(
7070
# hashfunction = sha256,
7171
# checkhash::Bool = true,
7272
)
73-
entry = getBlobentry(dfg, variable_label, entry_label)
73+
entry = getVariableBlobentry(dfg, variable_label, entry_label)
7474
blob = getBlob(dfg, entry)
7575
# checkhash && assertHash(de, db; hashfunction)
7676
return entry, blob
@@ -82,7 +82,7 @@ function saveBlob_Variable!(
8282
blob::Vector{UInt8},
8383
entry::Blobentry,
8484
)
85-
addBlobentry!(dfg, variable_label, entry)
85+
addVariableBlobentry!(dfg, variable_label, entry)
8686
addBlob!(dfg, entry, blob)
8787
return entry
8888
end
@@ -100,8 +100,8 @@ function saveBlob_Variable!(
100100
end
101101

102102
function deleteBlob_Variable!(dfg::AbstractDFG, variable_label::Symbol, entry_label::Symbol)
103-
entry = getBlobentry(dfg, variable_label, entry_label)
104-
deleteBlobentry!(dfg, variable_label, entry_label)
103+
entry = getVariableBlobentry(dfg, variable_label, entry_label)
104+
deleteVariableBlobentry!(dfg, variable_label, entry_label)
105105
deleteBlob!(dfg, entry)
106106
return 2
107107
end

src/DistributedFactorGraphs.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -451,13 +451,13 @@ const unstable_functions::Vector{Symbol} = [
451451
:getVariableTypeName,
452452
:getStateKind,
453453
:setTimestamp,
454-
:setMetadata!, # no set, use add merge
455454
:setAgentMetadata!,
456455
:setGraphMetadata!,
457456
# :getSolverDataDict,# obsolete
458457
:getAddHistory,
459458

460459
#Deprecated in v0.28
460+
:setMetadata!, # no set, use add merge
461461
:AbstractRelativeMinimize,
462462
:AbstractManifoldMinimize,
463463
:AbstractPrior,

src/FileDFG/services/FileDFG.jl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,18 +39,18 @@ function saveDFG(folder::AbstractString, dfg::AbstractDFG)
3939
map(f -> rm("$varFolder/$f"), readdir(varFolder))
4040
map(f -> rm("$factorFolder/$f"), readdir(factorFolder))
4141
# Variables
42-
@showprogress "saving variables" for v in variables
42+
@showprogress desc = "saving variables" for v in variables
4343
# vPacked = packVariable(v)
4444
JSON.json("$varFolder/$(v.label).json", v; style = DFGJSONStyle())
4545
end
4646
# Factors
47-
@showprogress "saving factors" for f in factors
47+
@showprogress desc = "saving factors" for f in factors
4848
JSON.json("$factorFolder/$(f.label).json", f; style = DFGJSONStyle())
4949
end
5050

5151
#GraphsDFG nodes
5252
@assert isa(dfg, GraphsDFG) "only metadata for GraphsDFG are supported"
53-
p = Progress(4, "Saving DFG Nodes")
53+
p = Progress(4; desc = "Saving DFG Nodes")
5454
JSON.json("$savepath/graphroot.json", dfg.graph; style = DFGJSONStyle())
5555
next!(p)
5656
JSON.json("$savepath/agent.json", dfg.agent; style = DFGJSONStyle())
@@ -119,7 +119,7 @@ function loadDFG!(
119119
variablefiles = readdir(joinpath(loaddir, "variables"); sort = false, join = true)
120120

121121
# type instability on `variables` as either `::Vector{Variable}` or `::Vector{VariableCompute{<:}}` (vector of abstract)
122-
variables = @showprogress 1 "loading variables" asyncmap(variablefiles) do file
122+
variables = @showprogress dt=1 desc = "loading variables" asyncmap(variablefiles) do file
123123
v = JSON.parsefile(file, V; style = DFGJSONStyle())
124124
return addVariable!(dfgLoadInto, v)
125125
end
@@ -128,7 +128,7 @@ function loadDFG!(
128128

129129
factorfiles = readdir(joinpath(loaddir, "factors"); sort = false, join = true)
130130

131-
factors = @showprogress 1 "loading factors" asyncmap(factorfiles) do file
131+
factors = @showprogress dt=1 desc = "loading factors" asyncmap(factorfiles) do file
132132
f = JSON.parsefile(file, F; style = DFGJSONStyle())
133133
return addFactor!(dfgLoadInto, f)
134134
end
@@ -137,7 +137,7 @@ function loadDFG!(
137137

138138
if isa(dfgLoadInto, GraphsDFG) && getTypeDFGFactors(dfgLoadInto) <: FactorDFG
139139
# Finally, rebuild the CCW's for the factors to completely reinflate them
140-
@showprogress 1 "Rebuilding factor solver cache" for factor in factors
140+
@showprogress dt=1 desc = "Rebuilding factor solver cache" for factor in factors
141141
rebuildFactorCache!(dfgLoadInto, factor)
142142
end
143143
end
@@ -170,7 +170,7 @@ function loadDFG(file::AbstractString)
170170
loaddir = Tar.extract(hdr -> contains(hdr.path, dfgnodenames), tar)
171171
close(tar)
172172

173-
progess = Progress(4, "Loading DFG Nodes")
173+
progess = Progress(4; desc="Loading DFG Nodes")
174174
agent = JSON.parsefile(joinpath(loaddir, "agent.json"), Agent; style = DFGJSONStyle())
175175
next!(progess)
176176
graph = JSON.parsefile(

src/GraphsDFG/services/GraphsDFG.jl

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -326,8 +326,9 @@ function listNeighbors(
326326
dfg::GraphsDFG,
327327
node::AbstractGraphNode;
328328
solvable::Union{Nothing, Int} = nothing,
329+
kwargs...,
329330
)
330-
return listNeighbors(dfg, node.label; solvable)
331+
return listNeighbors(dfg, node.label; solvable, kwargs...)
331332
end
332333

333334
function listNeighbors(
@@ -402,8 +403,9 @@ end
402403
function getBiadjacencyMatrix(
403404
dfg::GraphsDFG;
404405
solvable::Union{Nothing, Int} = nothing,
405-
varLabels = listVariables(dfg; solvable),
406-
factLabels = listFactors(dfg; solvable),
406+
solvableFilter = isnothing(solvable) ? nothing : >=(solvable),
407+
varLabels = listVariables(dfg; solvableFilter),
408+
factLabels = listFactors(dfg; solvableFilter),
407409
)
408410
varIndex = [dfg.g.labels[s] for s in varLabels]
409411
factIndex = [dfg.g.labels[s] for s in factLabels]

src/services/AbstractDFG.jl

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -358,10 +358,10 @@ function getVariable(dfg::AbstractDFG, label::Symbol, solveKey::Symbol)
358358
# function getVariable(dfg::AbstractDFG, label::Symbol; stateLabelFilter::Union{Nothing, ...} = nothing)
359359
var = getVariable(dfg, label)
360360

361-
if isa(var, VariableCompute) && !haskey(var.states, solveKey)
361+
if isa(var, VariableDFG) && !haskey(var.states, solveKey)
362362
throw(LabelNotFoundError("VariableNode", solveKey))
363-
elseif !isa(var, VariableCompute)
364-
@warn "getVariable(dfg, label, solveKey) only supported for type VariableCompute."
363+
elseif !isa(var, VariableDFG)
364+
@warn "getVariable(dfg, label, solveKey) only supported for type VariableDFG."
365365
end
366366

367367
return var
@@ -549,9 +549,8 @@ function deepcopyGraph(
549549
graphLabel::Symbol = Symbol(getGraphLabel(sourceDFG), "_cp_$(string(uuid4())[1:6])"),
550550
kwargs...,
551551
) where {T <: AbstractDFG}
552-
ginfo = getDFGInfo(sourceDFG)
553552

554-
destDFG = T(; ginfo..., graphLabel)
553+
destDFG = T(; graph=sourceDFG.graph, agent=sourceDFG.agent, graphLabel)
555554
copyGraph!(
556555
destDFG,
557556
sourceDFG,

src/services/CommonAccessors.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ Variables or factors may or may not be 'solvable', depending on a user definitio
4848
Related:
4949
- isSolveInProgress
5050
"""
51-
getSolvable(node::Union{VariableDFG, FactorDFG}) = node.solvable[]
51+
getSolvable(node::Union{VariableDFG, VariableSummary, FactorDFG, FactorSummary}) = node.solvable[]
5252

5353
"""
5454
$SIGNATURES

src/services/CompareUtils.jl

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -321,40 +321,40 @@ function compareFactor(
321321
)
322322
@debug "compareFactor 3/5" TP
323323

324-
#FIXME is measurement stil in use and should it be checked, skipping for now
325-
if false # !(:measurement in skip)
324+
#FIXME is measurement stil in use
325+
if !(:measurement in skip)
326326
TP =
327327
TP & (
328328
skipsamples || compareAll(
329-
getSolverData(A).fnc.measurement,
330-
getSolverData(B).fnc.measurement;
329+
getCache(A).measurement,
330+
getCache(B).measurement;
331331
show = show,
332332
skip = skip,
333333
)
334334
)
335335
end
336336
@debug "compareFactor 4/5" TP
337337
#FIXME is varValsAll stil in use and should it be checked, skipping for now
338-
if false #!(:varValsAll in skip) && hasfield(typeof(getSolverData(A).fnc), :varValsAll)
338+
if !(:varValsAll in skip) && hasfield(typeof(getCache(A)), :varValsAll)
339339
TP =
340340
TP & (
341341
skipcompute || compareAll(
342-
getSolverData(A).fnc.varValsAll,
343-
getSolverData(B).fnc.varValsAll;
342+
getCache(A).varValsAll,
343+
getCache(B).varValsAll;
344344
show = show,
345345
skip = skip,
346346
)
347347
)
348348
end
349349
@debug "compareFactor 5/5" TP
350-
#FIXME is varidx stil in use and should it be checked, skipping for now
351-
if false #!(:varidx in skip) && hasfield(typeof(getSolverData(A).fnc), :varidx) &&
352-
getSolverData(A).fnc.varidx isa Base.RefValue
350+
#FIXME is varidx stil in use and should it be checked
351+
if !(:varidx in skip) && hasfield(typeof(getCache(A)), :varidx) &&
352+
getCache(A).varidx isa Base.RefValue
353353
TP =
354354
TP & (
355355
skipcompute || compareAll(
356-
getSolverData(A).fnc.varidx[],
357-
getSolverData(B).fnc.varidx[];
356+
getCache(A).varidx[],
357+
getCache(B).varidx[];
358358
show = show,
359359
skip = skip,
360360
)

src/services/find.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ function findVariableNearTimestamp(
6161
#
6262
# get the variable labels based on filters
6363
# syms = listVariables(dfg, regexFilter, tags=tags, solvable=solvable)
64-
syms = listVariables(dfg, regexFilter; tags = tags, solvable = solvable)
64+
syms = listVariables(dfg, regexFilter; tags = tags, solvableFilter = >=(solvable))
6565
# compile timestamps with label
6666
# vars = map( x->getVariable(dfg, x), syms )
6767
timeset = map(x -> (getTimestamp(getVariable(dfg, x)), x), syms)

test/iifCompareTests.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ using Test
7575
skip = [:fullvariables],
7676
)
7777

78-
@test_broken !compareSimilarFactors(fg, fg2; skipsamples = true, skipcompute = false)
78+
@test !compareSimilarFactors(fg, fg2; skipsamples = true, skipcompute = false)
7979

8080
@test compareFactorGraphs(
8181
fg,

0 commit comments

Comments
 (0)