Skip to content

Commit 8630fcc

Browse files
authored
Merge pull request #361 from JuliaRobotics/master
v0.7.1-rc1
2 parents ad89652 + 0f83ee2 commit 8630fcc

File tree

12 files changed

+70
-52
lines changed

12 files changed

+70
-52
lines changed

.github/workflows/TagBot.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
name: TagBot
2+
23
on:
34
schedule:
4-
- cron: 0 * * * *
5+
- cron: '20 00 * * *'
6+
issues:
7+
types: [closed,]
8+
59
jobs:
610
TagBot:
711
runs-on: ubuntu-latest

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ matrix:
4141
allow_failures:
4242
- julia: nightly
4343
- arch: arm64
44-
- env: IIF_TEST=true
44+
#- env: IIF_TEST=true
4545

4646
# Set the password for Neo4j to neo4j:test
4747
before_script:

docs/src/GraphData.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ Example of PPE operations:
111111
# Add a new PPE of type MeanMaxPPE to :x0
112112
ppe = MeanMaxPPE(:default, [0.0], [0.0], [0.0])
113113
addPPE!(dfg, :x0, ppe)
114-
@show listPPE(dfg, :x0)
114+
@show listPPEs(dfg, :x0)
115115
# Get the data back - note that this is a reference to above.
116116
v = getPPE(dfg, :x0, :default)
117117
# Delete it

src/CloudGraphsDFG/services/CloudGraphsDFG.jl

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ function getVariable(dfg::CloudGraphsDFG, label::Union{Symbol, String})::DFGVari
181181
variable = unpackVariable(dfg, props)
182182

183183
# TODO - make this get PPE's in batch
184-
for ppe in listPPE(dfg, label)
184+
for ppe in listPPEs(dfg, label)
185185
variable.ppeDict[ppe] = getPPE(dfg, label, ppe)
186186
end
187187
return variable
@@ -220,11 +220,12 @@ function updateVariable!(dfg::CloudGraphsDFG, variable::DFGVariable)::DFGVariabl
220220
return variable
221221
end
222222

223-
function mergeUpdateVariableSolverData!(dfg::CloudGraphsDFG, sourceVariable::DFGVariable)::DFGVariable
223+
function mergeVariableData!(dfg::CloudGraphsDFG, sourceVariable::DFGVariable)::DFGVariable
224224
if !exists(dfg, sourceVariable)
225225
error("Source variable '$(sourceVariable.label)' doesn't exist in the graph.")
226226
end
227227
for (k,v) in sourceVariable.ppeDict
228+
# TODO what is happening inside, is this truely an update or is it a merge? (API consistency hounds are apon you)
228229
updatePPE!(dfg, getLabel(sourceVariable), v, k)
229230
end
230231
for (k,v) in sourceVariable.solverDataDict
@@ -233,6 +234,11 @@ function mergeUpdateVariableSolverData!(dfg::CloudGraphsDFG, sourceVariable::DFG
233234
return sourceVariable
234235
end
235236

237+
function mergeUpdateVariableSolverData!(dfg::CloudGraphsDFG, sourceVariable::DFGVariable)::DFGVariable
238+
@warn "Deprecated CloudGraphsDFG.mergeUpdateVariableSolverData!, use mergeVariableData! instead."
239+
mergeVariableData!(dfg, sourceVariable)
240+
end
241+
236242
function updateFactor!(dfg::CloudGraphsDFG, factor::DFGFactor)::DFGFactor
237243
if !exists(dfg, factor)
238244
@warn "Factor label '$(factor.label)' does not exist in the factor graph, adding"
@@ -435,7 +441,7 @@ end
435441

436442
### PPEs with DB calls
437443

438-
function listPPE(dfg::CloudGraphsDFG, variablekey::Symbol; currentTransaction::Union{Nothing, Neo4j.Transaction}=nothing)::Vector{Symbol}
444+
function listPPEs(dfg::CloudGraphsDFG, variablekey::Symbol; currentTransaction::Union{Nothing, Neo4j.Transaction}=nothing)::Vector{Symbol}
439445
query = "match (ppe:$(join(_getLabelsForType(dfg, MeanMaxPPE, parentKey=variablekey),':'))) return ppe.solverKey"
440446
@debug "[Query] PPE read query:\r\n$query"
441447
result = nothing
@@ -469,7 +475,7 @@ function getPPE(dfg::CloudGraphsDFG, variablekey::Symbol, ppekey::Symbol=:defaul
469475
end
470476

471477
function addPPE!(dfg::CloudGraphsDFG, variablekey::Symbol, ppe::P, ppekey::Symbol=:default; currentTransaction::Union{Nothing, Neo4j.Transaction}=nothing)::AbstractPointParametricEst where P <: AbstractPointParametricEst
472-
if ppekey in listPPE(dfg, variablekey, currentTransaction=currentTransaction)
478+
if ppekey in listPPEs(dfg, variablekey, currentTransaction=currentTransaction)
473479
error("PPE '$(ppekey)' already exists")
474480
end
475481
return updatePPE!(dfg, variablekey, ppe, ppekey, currentTransaction=currentTransaction)

src/Deprecated.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
@deprecate getFactorIds(dfg, regexFilter=nothing; solvable=0) listFactors(dfg, regexFilter, solvable=solvable)
1414

15+
@deprecate listPPE(args...) listPPEs(args...)
1516

1617
export getLabelDict
1718
getLabelDict(dfg::AbstractDFG) = error("getLabelDict is deprecated, consider using listing functions")

src/DistributedFactorGraphs.jl

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,17 +141,15 @@ export getMaxPPE, getMeanPPE, getSuggestedPPE, getLastUpdatedTimestamp
141141

142142
# accessors
143143

144-
export getPPEDict
144+
export getPPEDict, getVariablePPEDict, getVariablePPE
145145

146146
# CRUD & SET
147147
export getPPE,
148-
getPPEs,
149148
getVariablePPE,
150-
getVariablePPEs,
151149
addPPE!,
152150
updatePPE!,
153151
deletePPE!,
154-
listPPE,
152+
listPPEs,
155153
mergePPEs! #TODO look at rename to just mergePPE to match with cloud?
156154

157155

src/needsahome.jl

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -104,13 +104,6 @@ printVariable(dfg::AbstractDFG, sym::Symbol, solveKey::Symbol=:default) = print(
104104
print(dfg::AbstractDFG, sym::Symbol) = isVariable(dfg,sym) ? printVariable(dfg, sym) : printFactor(dfg, sym)
105105

106106

107-
#NOT too many aliases on PPE, brought back from deprecated DF
108-
109-
getVariablePPEs(v::VariableDataLevel1) = getPPEDict(v)
110-
111-
getPPEs(vari::VariableDataLevel1) = getPPEDict(v)
112-
113-
getVariablePPE(args...) = getPPE(args...)
114107

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

src/services/DFGVariable.jl

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ end
196196
"""
197197
$SIGNATURES
198198
199-
Get the PPE dictionary for a variable. Its direct use is not recomended.
199+
Get the PPE dictionary for a variable. Recommended to use CRUD operations instead, [`getPPE`](@ref), [`addPPE!`](@ref), [`updatePPE!`](@ref), [`deletePPE!`](@ref).
200200
"""
201201
getPPEDict(v::VariableDataLevel1) = v.ppeDict
202202

@@ -219,14 +219,25 @@ function getPPE(vari::VariableDataLevel1, solveKey::Symbol=:default)
219219
# return haskey(ppeDict, solveKey) ? ppeDict[solveKey] : nothing
220220
end
221221

222+
# afew more aliases on PPE, brought back from deprecated DF
223+
224+
"""
225+
$SIGNATURES
226+
227+
Return full dictionary of PPEs in a variable, recommended to rather use CRUD: [`getPPE`](@ref),
228+
"""
229+
getVariablePPEDict(vari::VariableDataLevel1) = getPPEDict(vari)
230+
231+
getVariablePPE(args...) = getPPE(args...)
232+
222233
##------------------------------------------------------------------------------
223234
## solverDataDict
224235
##------------------------------------------------------------------------------
225236

226237
"""
227238
$SIGNATURES
228239
229-
Get solver data dictionary for a variable.
240+
Get solver data dictionary for a variable. Advised to use graph CRUD operations instead.
230241
"""
231242
getSolverDataDict(v::DFGVariable) = v.solverDataDict
232243

@@ -427,6 +438,9 @@ function mergeVariableSolverData!(destVariable::DFGVariable, sourceVariable::DFG
427438
return destVariable
428439
end
429440

441+
mergeVariableSolverData!(dfg::AbstractDFG, sourceVariable::DFGVariable) = mergeVariableSolverData!(getVariable(dfg,getLabel(sourceVariable)), sourceVariable)
442+
443+
430444
##==============================================================================
431445
## Point Parametric Estimates
432446
##==============================================================================
@@ -478,7 +492,7 @@ addPPE!(dfg::AbstractDFG, sourceVariable::DFGVariable, ppekey::Symbol=:default)
478492

479493
"""
480494
$(SIGNATURES)
481-
Update PPE data if it exists, otherwise add it.
495+
Update PPE data if it exists, otherwise add it -- one call per `key::Symbol=:default`.
482496
"""
483497
function updatePPE!(dfg::AbstractDFG, variablekey::Symbol, ppe::P, ppekey::Symbol=:default)::P where P <: AbstractPointParametricEst
484498

@@ -539,7 +553,7 @@ deletePPE!(dfg::AbstractDFG, sourceVariable::DFGVariable, ppekey::Symbol=:defaul
539553
$(SIGNATURES)
540554
List all the PPE data keys in the variable.
541555
"""
542-
function listPPE(dfg::AbstractDFG, variablekey::Symbol)::Vector{Symbol}
556+
function listPPEs(dfg::AbstractDFG, variablekey::Symbol)::Vector{Symbol}
543557
v = getVariable(dfg, variablekey)
544558
return collect(keys(v.ppeDict))
545559
end

test/LightDFGSummaryTypes.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ end
4040

4141
if VARTYPE == DFGVariableSummary
4242
@test getTimestamp(v1) == v1.timestamp
43-
@test getVariablePPEs(v1) == v1.ppeDict
43+
@test getVariablePPEDict(v1) == v1.ppeDict
4444
@test_throws KeyError getVariablePPE(v1, :notfound)
4545
@test getSofttypename(v1) == :Pose2
4646
@test getInternalId(v1) == v1._internalId

test/fileDFGTests.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ using Test
4040

4141
copyDfg = DistributedFactorGraphs._getDuplicatedEmptyDFG(dfg)
4242
@info "Going to load $filename"
43-
retDFG = loadDFG(filename, Main, copyDfg, loaddir="/tmp")
43+
retDFG = loadDFG(filename, Main, copyDfg) #, loaddir="/tmp")
4444

4545
@test issetequal(ls(dfg), ls(retDFG))
4646
@test issetequal(lsf(dfg), lsf(retDFG))

0 commit comments

Comments
 (0)