Skip to content

Commit 3301d4f

Browse files
authored
update broken and missing docstrings (#303)
* update broken and missing * update field accessor ref ♥regex
1 parent 6b903b7 commit 3301d4f

File tree

11 files changed

+57
-126
lines changed

11 files changed

+57
-126
lines changed

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/LightDFG/FactorGraphs/FactorGraphs.jl

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,6 @@ zero(g::FactorGraph{T,V,F}) where {T,V,F} = FactorGraph{T,V,F}(0,0)
9595

9696
# TODO issubset(g::T, h::T) where T <: FactorGraph = issubset(g.graph, h.graph)
9797

98-
"""
99-
add_edge!(g, u, v)
100-
Add an edge `(u, v)` to FactorGraph `g`.
101-
return true if the edge has been added, false otherwise
102-
"""
10398
@inline add_edge!(g::FactorGraph, x...) = add_edge!(g.graph, x...)
10499

105100
@inline rem_edge!(g::FactorGraph, x...) = rem_edge!(g.graph, x...)

src/entities/DFGFactor.jl

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -69,38 +69,38 @@ $(TYPEDFIELDS)
6969
"""
7070
mutable struct DFGFactor{T, S} <: AbstractDFGFactor
7171
"""Factor label, e.g. :x1f1.
72-
Accessor: `getLabel`"""
72+
Accessor: [`getLabel`](@ref)"""
7373
label::Symbol
7474
"""Variable timestamp.
75-
Accessors: `getTimestamp`, `setTimestamp!`"""
75+
Accessors: [`getTimestamp`](@ref), [`setTimestamp`](@ref)"""
7676
timestamp::DateTime
7777
"""Factor tags, e.g [:FACTOR].
78-
Accessors: `getTags`, `addTags!`, and `deleteTags!`"""
78+
Accessors: [`getTags`](@ref), [`mergeTags!`](@ref), and [`removeTags!`](@ref)"""
7979
tags::Set{Symbol}
8080
"""Solver data.
81-
Accessors: `getSolverData`, `setSolverData!`"""
81+
Accessors: [`getSolverData`](@ref), [`setSolverData!`](@ref)"""
8282
solverData::GenericFunctionNodeData{T, S}
8383
"""Solvable flag for the factor.
84-
Accessors: `getSolvable`, `setSolvable!`
84+
Accessors: [`getSolvable`](@ref), [`setSolvable!`](@ref)
8585
TODO: Switch to `DFGNodeParams`"""
8686
solvable::Int #TODO we can go with DFGNodeParams or Reference the solvable field with getproperty overload
8787
"""Mutable parameters for the variable. We suggest using accessors to get to this data.
88-
Accessors: `getSolvable`, `setSolvable!`"""
88+
Accessors: [`getSolvable`](@ref), [`setSolvable!`](@ref)"""
8989
_dfgNodeParams::DFGNodeParams
9090
"""Internal cache of the ordering of the neighbor variables. Rather use getNeighbors to get the list as this is an internal value.
91-
Accessors: `getVariableOrder`"""
91+
Accessors: [`getVariableOrder`](@ref)"""
9292
_variableOrderSymbols::Vector{Symbol}
9393
end
9494

9595
##------------------------------------------------------------------------------
9696
## Constructors
9797

98+
#TODO _internalId?
9899
"""
99100
$(SIGNATURES)
100101
101102
Construct a DFG factor given a label.
102103
"""
103-
#TODO _internalId?
104104
DFGFactor{T, S}(label::Symbol, internalId::Int64=0, timestamp::DateTime=now()) where {T, S} =
105105
DFGFactor(label, timestamp, Set{Symbol}(), GenericFunctionNodeData{T, S}(), 1, DFGNodeParams(1, internalId), Symbol[])
106106

@@ -130,18 +130,18 @@ $(TYPEDFIELDS)
130130
"""
131131
struct DFGFactorSummary <: AbstractDFGFactor
132132
"""Factor label, e.g. :x1f1.
133-
Accessor: `getLabel`"""
133+
Accessor: [`getLabel`](@ref)"""
134134
label::Symbol
135135
"""Variable timestamp.
136-
Accessors: `getTimestamp`"""
136+
Accessors: [`getTimestamp`](@ref)"""
137137
timestamp::DateTime
138138
"""Factor tags, e.g [:FACTOR].
139-
Accessors: `getTags`, `addTags!`, and `deleteTags!`"""
139+
Accessors: [`getTags`](@ref), [`mergeTags!`](@ref), and [`removeTags!`](@ref)"""
140140
tags::Set{Symbol}
141141
"""Internal ID used by some of the DFG drivers. We don't suggest using this outside of DFG."""
142142
_internalId::Int64
143143
"""Internal cache of the ordering of the neighbor variables. Rather use getNeighbors to get the list as this is an internal value.
144-
Accessors: `getVariableOrder`"""
144+
Accessors: [`getVariableOrder`](@ref)"""
145145
_variableOrderSymbols::Vector{Symbol}
146146
end
147147

@@ -159,13 +159,13 @@ $(TYPEDFIELDS)
159159
"""
160160
struct SkeletonDFGFactor <: AbstractDFGFactor
161161
"""Factor label, e.g. :x1f1.
162-
Accessor: `getLabel`"""
162+
Accessor: [`getLabel`](@ref)"""
163163
label::Symbol
164164
"""Factor tags, e.g [:FACTOR].
165-
Accessors: `getTags`, `addTags!`, and `deleteTags!`"""
165+
Accessors: [`getTags`](@ref), [`mergeTags!`](@ref), and [`removeTags!`](@ref)"""
166166
tags::Set{Symbol}
167167
"""Internal cache of the ordering of the neighbor variables. Rather use getNeighbors to get the list as this is an internal value.
168-
Accessors: `getVariableOrder`"""
168+
Accessors: [`getVariableOrder`](@ref)"""
169169
_variableOrderSymbols::Vector{Symbol}
170170
end
171171

src/entities/DFGVariable.jl

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -178,28 +178,28 @@ $(TYPEDFIELDS)
178178
"""
179179
struct DFGVariable{T<:InferenceVariable} <: AbstractDFGVariable
180180
"""Variable label, e.g. :x1.
181-
Accessor: `getLabel`"""
181+
Accessor: [`getLabel`](@ref)"""
182182
label::Symbol
183183
"""Variable timestamp.
184-
Accessors: `getTimestamp`, `setTimestamp!`"""
184+
Accessors: [`getTimestamp`](@ref), [`setTimestamp`](@ref)"""
185185
timestamp::DateTime
186186
"""Variable tags, e.g [:POSE, :VARIABLE, and :LANDMARK].
187-
Accessors: `getTags`, `addTags!`, and `deleteTags!`"""
187+
Accessors: [`getTags`](@ref), [`mergeTags!`](@ref), and [`removeTags!`](@ref)"""
188188
tags::Set{Symbol}
189189
"""Dictionary of parametric point estimates keyed by solverDataDict keys
190-
Accessors: `addPPE!`, `updatePPE!`, and `deletePPE!`"""
190+
Accessors: [`addPPE!`](@ref), [`updatePPE!`](@ref), and [`deletePPE!`](@ref)"""
191191
ppeDict::Dict{Symbol, <: AbstractPointParametricEst}
192192
"""Dictionary of solver data. May be a subset of all solutions if a solver key was specified in the get call.
193-
Accessors: `addVariableSolverData!`, `updateVariableSolverData!`, and `deleteVariableSolverData!`"""
193+
Accessors: [`addVariableSolverData!`](@ref), [`updateVariableSolverData!`](@ref), and [`deleteVariableSolverData!`](@ref)"""
194194
solverDataDict::Dict{Symbol, VariableNodeData{T}}
195195
"""Dictionary of small data associated with this variable.
196-
Accessors: [`getSmallData!`](@ref), [`setSmallData!`](@ref)"""
196+
Accessors: [`getSmallData`](@ref), [`setSmallData!`](@ref)"""
197197
smallData::Dict{String, String}#Ref{Dict{String, String}} #why was Ref here?
198198
"""Dictionary of large data associated with this variable.
199-
Accessors: `addBigDataEntry!`, `getBigDataEntry`, `updateBigDataEntry!`, and `deleteBigDataEntry!`"""
199+
Accessors: [`addBigDataEntry!`](@ref), [`getBigDataEntry`](@ref), [`updateBigDataEntry!`](@ref), and [`deleteBigDataEntry!`](@ref)"""
200200
bigData::Dict{Symbol, AbstractBigDataEntry}
201201
"""Mutable parameters for the variable. We suggest using accessors to get to this data.
202-
Accessors: `getSolvable`, `setSolvable!`"""
202+
Accessors: [`getSolvable`](@ref), [`setSolvable!`](@ref)"""
203203
_dfgNodeParams::DFGNodeParams
204204
end
205205

@@ -254,22 +254,22 @@ $(TYPEDFIELDS)
254254
"""
255255
struct DFGVariableSummary <: AbstractDFGVariable
256256
"""Variable label, e.g. :x1.
257-
Accessor: `getLabel`"""
257+
Accessor: [`getLabel`](@ref)"""
258258
label::Symbol
259259
"""Variable timestamp.
260-
Accessors: `getTimestamp`, `setTimestamp!`"""
260+
Accessors: [`getTimestamp`](@ref), [`setTimestamp`](@ref)"""
261261
timestamp::DateTime
262262
"""Variable tags, e.g [:POSE, :VARIABLE, and :LANDMARK].
263-
Accessors: `getTags`, `addTags!`, and `deleteTags!`"""
263+
Accessors: [`getTags`](@ref), [`mergeTags!`](@ref), and [`removeTags!`](@ref)"""
264264
tags::Set{Symbol}
265265
"""Dictionary of parametric point estimates keyed by solverDataDict keys
266-
Accessors: `addPPE!`, `updatePPE!`, and `deletePPE!`"""
266+
Accessors: [`addPPE!`](@ref), [`updatePPE!`](@ref), and [`deletePPE!`](@ref)"""
267267
ppeDict::Dict{Symbol, <:AbstractPointParametricEst}
268268
"""Symbol for the softtype for the underlying variable.
269-
Accessor: `getSofttype`"""
269+
Accessor: [`getSofttype`](@ref)"""
270270
softtypename::Symbol
271271
"""Dictionary of large data associated with this variable.
272-
Accessors: `addBigDataEntry!`, `getBigDataEntry`, `updateBigDataEntry!`, and `deleteBigDataEntry!`"""
272+
Accessors: [`addBigDataEntry!`](@ref), [`getBigDataEntry`](@ref), [`updateBigDataEntry!`](@ref), and [`deleteBigDataEntry!`](@ref)"""
273273
bigData::Dict{Symbol, AbstractBigDataEntry}
274274
"""Internal ID used by some of the DFG drivers. We don't suggest using this outside of DFG."""
275275
_internalId::Int64
@@ -289,10 +289,10 @@ $(TYPEDFIELDS)
289289
"""
290290
struct SkeletonDFGVariable <: AbstractDFGVariable
291291
"""Variable label, e.g. :x1.
292-
Accessor: `getLabel`"""
292+
Accessor: [`getLabel`](@ref)"""
293293
label::Symbol
294294
"""Variable tags, e.g [:POSE, :VARIABLE, and :LANDMARK].
295-
Accessors: `getTags`, `addTags!`, and `deleteTags!`"""
295+
Accessors: [`getTags`](@ref), [`mergeTags!`](@ref), and [`removeTags!`](@ref)"""
296296
tags::Set{Symbol}
297297
end
298298

src/services/AbstractDFG.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -966,14 +966,14 @@ end
966966

967967

968968

969+
# TODO API name get seems wrong maybe just biadjacencyMatrix
969970
"""
970971
$(SIGNATURES)
971972
Get a matrix indicating adjacency between variables and factors. Returned as
972973
a named tuple: B::SparseMatrixCSC{Int}, varLabels::Vector{Symbol)
973974
facLabels::Vector{Symbol). Rows are the factors, columns are the variables,
974975
with the corresponding labels in varLabels,facLabels.
975976
"""
976-
# TODO API name get seems wrong maybe just biadjacencyMatrix
977977
function getBiadjacencyMatrix(dfg::AbstractDFG; solvable::Int=0)::NamedTuple{(:B, :varLabels, :facLabels), Tuple{SparseMatrixCSC, Vector{Symbol}, Vector{Symbol}}}
978978
varLabels = map(v->v.label, getVariables(dfg, solvable=solvable))
979979
factLabels = map(f->f.label, getFactors(dfg, solvable=solvable))

0 commit comments

Comments
 (0)