Skip to content

Commit 9540c7f

Browse files
authored
Merge pull request #138 from JuliaRobotics/feature/137_remove_metasymbolexports
Removing MetaGraphsDFG and SymbolDFG exports, adding test
2 parents 2005021 + 3fe299c commit 9540c7f

File tree

7 files changed

+26
-13
lines changed

7 files changed

+26
-13
lines changed

src/DFGPlots/DFGPlots.jl

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ DFGPlotProps() = DFGPlotProps( (var=colorant"seagreen", fac=colorant"cyan3"),
3232

3333
"""
3434
$(SIGNATURES)
35-
Plots the structure of the factor graph. GraphPlot must be imported before DistributedFactoGraphs for these functions to be available.
35+
Plots the structure of the factor graph. GraphPlot must be imported before DistributedFactorGraphs for these functions to be available.
3636
Returns the plot context.
3737
3838
E.g.
@@ -86,8 +86,8 @@ draw(PDF("/tmp/graph.pdf", 16cm, 16cm), dfgplot(fg))
8686
8787
More information at [GraphPlot.jl](https://github.com/JuliaGraphs/GraphPlot.jl)
8888
"""
89-
function dfgplot(dfg::MetaGraphsDFG, p::DFGPlotProps = DFGPlotProps())
90-
89+
function dfgplot(dfg::DistributedFactorGraphs.MetaGraphsDFG, p::DFGPlotProps = DFGPlotProps())
90+
@info "Deprecated, please use GraphsDFG or LightDFG."
9191
nodesize = [has_prop(dfg.g,i,:factor) ? p.nodesize.fac : p.nodesize.var for i=vertices(dfg.g)]
9292
if p.drawlabels
9393
nodelabel = [has_prop(dfg.g,i,:factor) ? "" : string(get_prop(dfg.g,i,:label)) for i=vertices(dfg.g)]
@@ -122,13 +122,14 @@ More information at [GraphPlot.jl](https://github.com/JuliaGraphs/GraphPlot.jl)
122122
function dfgplot(dfg::AbstractDFG, p::DFGPlotProps = DFGPlotProps())
123123
# TODO implement convert functions
124124
@warn "TODO Implement convert"
125-
ldfg = MetaGraphsDFG{AbstractParams}()
125+
ldfg = LightDFG{AbstractParams}()
126126
DistributedFactorGraphs._copyIntoGraph!(dfg, ldfg, union(getVariableIds(dfg), getFactorIds(dfg)), true)
127127

128128
dfgplot(ldfg, p)
129129
end
130130

131-
function gplot(dfg::MetaGraphsDFG; keyargs...)
131+
function gplot(dfg::DistributedFactorGraphs.MetaGraphsDFG; keyargs...)
132+
@info "Deprecated, please use GraphsDFG or LightDFG."
132133
gplot(dfg.g; keyargs...)
133134
end
134135

src/DistributedFactorGraphs.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ include("FileDFG/FileDFG.jl")
6161
include("MetaGraphsDFG/MetaGraphsDFG.jl")
6262

6363
include("SymbolDFG/SymbolDFG.jl")
64-
@reexport using .SymbolDFGs
64+
# @reexport using .SymbolDFGs
6565

6666
include("LightDFG/LightDFG.jl")
6767
@reexport using .LightDFGs

src/LightDFG/services/LightDFG.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ end
240240
Checks if the graph is fully connected, returns true if so.
241241
"""
242242
function isFullyConnected(dfg::LightDFG)::Bool
243-
return length(connected_components(dfg.g)) == 1
243+
return length(LightGraphs.connected_components(dfg.g)) == 1
244244
end
245245

246246
function _isready(dfg::LightDFG, label::Symbol, ready::Int)::Bool

src/MetaGraphsDFG/MetaGraphsDFG.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ include("entities/MetaGraphsDFG.jl")
66
include("services/MetaGraphsDFG.jl")
77

88
# Exports
9-
export MetaGraphsDFG
9+
# Deprecated -
10+
# export MetaGraphsDFG
1011
export exists
1112
export getLabelDict, getDescription, setDescription, getInnerGraph, getAddHistory, getSolverParams, setSolverParams
1213
#

src/SymbolDFG/SymbolDFG.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module SymbolDFGs
1+
# module SymbolDFGs
22

33
using LightGraphs
44
using SparseArrays
@@ -45,7 +45,7 @@ include("entities/SymbolDFG.jl")
4545
include("services/SymbolDFG.jl")
4646

4747
# Exports
48-
export SymbolDFG
48+
# export SymbolDFG
4949

5050

51-
end
51+
# end

src/SymbolDFG/services/SymbolDFG.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ end
264264
Checks if the graph is fully connected, returns true if so.
265265
"""
266266
function isFullyConnected(dfg::SymbolDFG)::Bool
267-
return length(connected_components(dfg.g)) == 1
267+
return length(LightGraphs.connected_components(dfg.g)) == 1
268268
end
269269

270270
#Alias

test/runtests.jl

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,12 @@ using GraphPlot # For plotting tests
33
using DistributedFactorGraphs
44

55
# Test each interface
6-
apis = [GraphsDFG, MetaGraphsDFG, SymbolDFG, LightDFG]
6+
# Still test LightDFG and MetaGraphsDFG for the moment until we remove in 0.4.2
7+
apis = [
8+
GraphsDFG,
9+
DistributedFactorGraphs.MetaGraphsDFG,
10+
DistributedFactorGraphs.SymbolDFG,
11+
LightDFG]
712
for api in apis
813
@testset "Testing Driver: $(api)" begin
914
@info "Testing Driver: $(api)"
@@ -12,6 +17,12 @@ for api in apis
1217
end
1318
end
1419

20+
# Test that we don't export LightDFG and MetaGraphsDFG
21+
@testset "Deprecated Drivers Test" begin
22+
@test_throws UndefVarError SymbolDFG{NoSolverParams}()
23+
@test_throws UndefVarError MetaGraphsDFG{NoSolverParams}()
24+
end
25+
1526
# Test special cases
1627

1728
@testset "Plotting Tests" begin

0 commit comments

Comments
 (0)