Skip to content

Commit 55049e4

Browse files
committed
Merge branch 'master' of https://github.com/JuliaRobotics/DistributedFactorGraphs.jl into 1Q20/cgdfg_ppes
2 parents 3aa2247 + 3301d4f commit 55049e4

35 files changed

+3377
-3135
lines changed

.github/workflows/TagBot.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: TagBot
2+
on:
3+
schedule:
4+
- cron: 0 * * * *
5+
jobs:
6+
TagBot:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: JuliaRegistries/TagBot@v1
10+
with:
11+
token: ${{ secrets.GITHUB_TOKEN }}

.travis.yml

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,33 +7,33 @@ os:
77

88
arch:
99
- amd64
10-
#FIXME# - arm64
1110

1211
services:
1312
- neo4j
1413

1514
julia:
16-
#FIXME# - 1.0
15+
- 1.0
1716
- 1.2
18-
#FIXME# - 1.3
19-
#FIXME# - nightly
17+
- 1.3
18+
- nightly
2019

2120
env:
22-
- IIF_TEST=true
23-
24-
#FIXME#jobs:
25-
#FIXME# include:
26-
#FIXME# - julia: 1.2
27-
#FIXME# env: IIF_TEST=true
28-
#FIXME# if: NOT branch =~ ^release.*$
29-
#FIXME# - stage: "Documentation"
30-
#FIXME# julia: 1.2
31-
#FIXME# os: linux
32-
#FIXME# script:
33-
#FIXME# - julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()'
34-
#FIXME# - julia --project=docs/ docs/make.jl
35-
#FIXME# after_success: skip
36-
#FIXME# fast_finish: true
21+
- IIF_TEST=false
22+
23+
jobs:
24+
include:
25+
- julia: 1.2
26+
env: IIF_TEST=true
27+
if: NOT branch =~ ^release.*$
28+
- arch: arm64
29+
- stage: "Documentation"
30+
julia: 1.2
31+
os: linux
32+
script:
33+
- julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()'
34+
- julia --project=docs/ docs/make.jl
35+
after_success: skip
36+
fast_finish: true
3737

3838
notifications:
3939
email: false

docs/Project.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
[deps]
22
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
3+
GraphPlot = "a2cc645c-3eea-5389-862e-a155d0052231"
34
LightGraphs = "093fc24a-ae57-5d10-9952-331d41423f4d"
45

56
[compat]

docs/make.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using Documenter
2+
using GraphPlot
23
using DistributedFactorGraphs
34

45
makedocs(

docs/src/BuildingGraphs.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,16 +111,16 @@ Reading, updating, and deleting all use DFG functions (as opposed to adding,
111111
where using the IncrementalInference functions are recommended).
112112

113113
Each variable and factor is uniquely identified by its label. The list of
114-
variable and factor labels can be retrieved with the `ls`/`getVariableIds` and
115-
`lsf`/`getFactorIds` functions:
114+
variable and factor labels can be retrieved with the `ls`/`listVariables` and
115+
`lsf`/`listFactors` functions:
116116

117117
```@docs
118-
getVariableIds
118+
listVariables
119119
ls
120120
```
121121

122122
```@docs
123-
getFactorIds
123+
listFactors
124124
lsf
125125
```
126126

docs/src/GraphData.md

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -43,27 +43,24 @@ Labels are the principle identifier of a variable or factor.
4343
getLabel
4444
```
4545

46-
```@docs
47-
getLabel
48-
```
49-
5046
#### Timestamps
5147

5248
Each variable or factor can have a timestamp associated with it.
5349

5450
```@docs
5551
getTimestamp
56-
setTimestamp!
52+
setTimestamp
5753
```
5854

5955
#### Tags
6056

6157
Tags are a set of symbols that contain identifiers for the variable or factor.
6258

6359
```@docs
64-
addTag
60+
listTags
6561
mergeTags!
66-
deleteTags!
62+
removeTags!
63+
emptyTags!
6764
```
6865

6966
### Solvable
@@ -95,7 +92,6 @@ For each PPE structure, there are accessors for getting individual values:
9592
getMaxPPE
9693
getMeanPPE
9794
getSuggestedPPE
98-
getPPE
9995
```
10096

10197
Related functions for getting, adding/updating, and deleting PPE structures:
@@ -106,6 +102,7 @@ getPPE
106102
addPPE!
107103
updatePPE!
108104
deletePPE!
105+
mergePPEs!
109106
```
110107

111108
Example of PPE operations:
@@ -139,6 +136,7 @@ getVariableSolverData
139136
addVariableSolverData!
140137
updateVariableSolverData!
141138
deleteVariableSolverData!
139+
mergeVariableSolverData!
142140
```
143141

144142
Example of solver data operations:
@@ -163,7 +161,7 @@ itself, large entries will slow the graph down, so if data should exceed a
163161
few bytes/kb, it should rather be saved in bigData.
164162

165163
```@docs
166-
getSmallData,
164+
getSmallData
167165
setSmallData!
168166
```
169167

docs/src/TraversingAndQuerying.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,5 @@
44
getNeighbors
55
getSubgraphAroundNode
66
getSubgraph
7-
getIncidenceMatrix
8-
getIncidenceMatrixSparse
7+
getBiadjacencyMatrix
98
```

docs/src/func_ref.md

Lines changed: 2 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -7,67 +7,6 @@ Pages = [
77
Depth = 3
88
```
99

10-
### Graph Types
11-
```@docs
12-
GraphsDFG
13-
```
14-
15-
### Creating DFG Factor Graphs
16-
```@docs
17-
addVariable!
18-
addFactor!
19-
```
20-
21-
### Getting Factor Graph Nodes
22-
```@docs
23-
getVariables
24-
getFactors
25-
getVariable
26-
getFactor
27-
getNeighbors
28-
ls
29-
lsf
30-
```
31-
32-
### Updating Factor Graph Nodes
33-
```@docs
34-
updateVariable!
35-
updateFactor!
36-
```
37-
38-
### Deleting Factor Graph Nodes
39-
```@docs
40-
deleteVariable!
41-
deleteFactor!
42-
```
43-
44-
### Getting Adjacency Matrix
45-
```@docs
46-
getIncidenceMatrix
47-
getIncidenceMatrixSparse
48-
```
49-
50-
### Validating Factor Graph Connectivity
51-
```@docs
52-
isFullyConnected
53-
hasOrphans
54-
```
55-
56-
### Copying Subgraphs
57-
```@docs
58-
getSubgraphAroundNode
59-
getSubgraph
60-
```
61-
62-
### Summaries
63-
```@docs
64-
getSummary
65-
getSummaryGraph
66-
```
67-
68-
### Visualization and Plotting
69-
```@docs
70-
toDot
71-
toDotFile
72-
dfgplot
10+
```@autodocs
11+
Modules = [DistributedFactorGraphs, LightDFGs, DFGPlots]
7312
```

src/BigData/services/AbstractBigDataEntries.jl

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,96 @@ end
1515
function ==(a::FileBigDataEntry, b::FileBigDataEntry)
1616
return a.key == b.key && a.filename == b.filename
1717
end
18+
19+
"""
20+
$(SIGNATURES)
21+
Add Big Data Entry to a DFG variable
22+
"""
23+
function addBigDataEntry!(var::AbstractDFGVariable, bde::AbstractBigDataEntry)::AbstractBigDataEntry
24+
haskey(var.bigData,bde.key) && error("BigData entry $(bde.key) already exists in variable")
25+
var.bigData[bde.key] = bde
26+
return bde
27+
end
28+
29+
"""
30+
$(SIGNATURES)
31+
Add Big Data Entry to distributed factor graph.
32+
Should be extended if DFG variable is not returned by reference.
33+
"""
34+
function addBigDataEntry!(dfg::AbstractDFG, label::Symbol, bde::AbstractBigDataEntry)::AbstractBigDataEntry
35+
return addBigDataEntry!(getVariable(dfg, label), bde)
36+
end
37+
38+
"""
39+
$(SIGNATURES)
40+
Get big data entry
41+
"""
42+
function getBigDataEntry(var::AbstractDFGVariable, key::Symbol)::Union{Nothing, AbstractBigDataEntry}
43+
!haskey(var.bigData, key) && (error("BigData entry $(key) does not exist in variable"); return nothing)
44+
return var.bigData[key]
45+
end
46+
47+
function getBigDataEntry(dfg::AbstractDFG, label::Symbol, key::Symbol)::Union{Nothing, AbstractBigDataEntry}
48+
return getBigDataEntry(getVariable(dfg, label), key)
49+
end
50+
51+
"""
52+
$(SIGNATURES)
53+
Update big data entry
54+
"""
55+
function updateBigDataEntry!(var::AbstractDFGVariable, bde::AbstractBigDataEntry)::Union{Nothing, AbstractBigDataEntry}
56+
!haskey(var.bigData,bde.key) && (@warn "$(bde.key) does not exist in variable, adding")
57+
var.bigData[bde.key] = bde
58+
return bde
59+
end
60+
function updateBigDataEntry!(dfg::AbstractDFG, label::Symbol, bde::AbstractBigDataEntry)::Union{Nothing, AbstractBigDataEntry}
61+
# !isVariable(dfg, label) && return nothing
62+
return updateBigDataEntry!(getVariable(dfg, label), bde)
63+
end
64+
65+
"""
66+
$(SIGNATURES)
67+
Delete big data entry from the factor graph.
68+
Note this doesn't remove it from any data stores.
69+
"""
70+
function deleteBigDataEntry!(var::AbstractDFGVariable, key::Symbol)::Union{Nothing, AbstractDFGVariable} #users responsibility to delete big data in db before deleting entry
71+
bde = getBigDataEntry(var, key)
72+
bde == nothing && return nothing
73+
delete!(var.bigData, key)
74+
return var
75+
end
76+
function deleteBigDataEntry!(dfg::AbstractDFG, label::Symbol, key::Symbol)::Union{Nothing, AbstractDFGVariable} #users responsibility to delete big data in db before deleting entry
77+
!isVariable(dfg, label) && return nothing
78+
return deleteBigDataEntry!(getVariable(dfg, label), key)
79+
end
80+
81+
function deleteBigDataEntry!(var::AbstractDFGVariable, entry::AbstractBigDataEntry)::Union{Nothing, AbstractDFGVariable} #users responsibility to delete big data in db before deleting entry
82+
return deleteBigDataEntry!(var, entry.key)
83+
end
84+
85+
"""
86+
$(SIGNATURES)
87+
Get big data entries, Vector{AbstractBigDataEntry}
88+
"""
89+
function getBigDataEntries(var::AbstractDFGVariable)::Vector{AbstractBigDataEntry}
90+
#or should we return the iterator, Base.ValueIterator{Dict{Symbol,AbstractBigDataEntry}}?
91+
collect(values(var.bigData))
92+
end
93+
function getBigDataEntries(dfg::AbstractDFG, label::Symbol)::Union{Nothing, Vector{AbstractBigDataEntry}}
94+
!isVariable(dfg, label) && return nothing
95+
#or should we return the iterator, Base.ValueIterator{Dict{Symbol,AbstractBigDataEntry}}?
96+
getBigDataEntries(getVariable(dfg, label))
97+
end
98+
99+
100+
"""
101+
$(SIGNATURES)
102+
getBigDataKeys
103+
"""
104+
function getBigDataKeys(var::AbstractDFGVariable)::Vector{Symbol}
105+
collect(keys(var.bigData))
106+
end
107+
function getBigDataKeys(dfg::AbstractDFG, label::Symbol)::Union{Nothing, Vector{Symbol}}
108+
!isVariable(dfg, label) && return nothing
109+
getBigDataKeys(getVariable(dfg, label))
110+
end

src/CloudGraphsDFG/services/CloudGraphsDFG.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,8 +306,9 @@ function getFactors(dfg::CloudGraphsDFG, regexFilter::Union{Nothing, Regex}=noth
306306
return map(vId->getFactor(dfg, vId), factorIds)
307307
end
308308

309-
function listFactors(dfg::CloudGraphsDFG, regexFilter::Union{Nothing, Regex}=nothing; solvable::Int=0)::Vector{Symbol}
309+
function listFactors(dfg::CloudGraphsDFG, regexFilter::Union{Nothing, Regex}=nothing; tags::Vector{Symbol}=Symbol[], solvable::Int=0)::Vector{Symbol}
310310
# Optimized for DB call
311+
length(tags) > 0 && (@error "Filter on tags not implemented for CloudGraphsDFG")
311312
if regexFilter == nothing
312313
return _getLabelsFromCyphonQuery(dfg.neo4jInstance, "(node:$(join(_getLabelsForType(dfg, DFGFactor),':'))) where node.solvable >= $solvable")
313314
else

0 commit comments

Comments
 (0)