Skip to content

Commit 9deaa82

Browse files
committed
MetaGraphs to attic, starting cleanup
1 parent d5a5ced commit 9deaa82

File tree

10 files changed

+52
-82
lines changed

10 files changed

+52
-82
lines changed

Project.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ Graphs = "86223c79-3864-5bf0-83f7-82e725a168b6"
1313
JSON2 = "2535ab7d-5cd8-5a07-80ac-9b1792aadce3"
1414
LightGraphs = "093fc24a-ae57-5d10-9952-331d41423f4d"
1515
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
16-
MetaGraphs = "626554b9-1ddb-594c-aa3c-2596fe9399a5"
1716
Neo4j = "d2adbeaf-5838-5367-8a2f-e46d570981db"
1817
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
1918
Requires = "ae029012-a4dd-5104-9daa-d747884805df"
@@ -27,7 +26,6 @@ GraphPlot = "0.3.1, 0.4"
2726
Graphs = "0.10.2, 0.11, 1"
2827
JSON2 = "0.3.1"
2928
LightGraphs = "1.2, 1.3"
30-
MetaGraphs = "^0.6.3"
3129
Neo4j = "2"
3230
Reexport = "0.2, 0.3, 0.4, 0.5, 1"
3331
Requires = "0.5, 0.6, 0.7, 0.8, 0.9, 0.10, 1"

src/DFGPlots/DFGPlots.jl

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ module DFGPlots
22

33
using Colors
44
using LightGraphs
5-
using MetaGraphs
65
using GraphPlot
76
using DocStringExtensions
87
import GraphPlot: gplot
@@ -84,39 +83,6 @@ using Compose
8483
draw(PDF("/tmp/graph.pdf", 16cm, 16cm), dfgplot(fg))
8584
```
8685
87-
More information at [GraphPlot.jl](https://github.com/JuliaGraphs/GraphPlot.jl)
88-
"""
89-
function dfgplot(dfg::DistributedFactorGraphs.MetaGraphsDFG, p::DFGPlotProps = DFGPlotProps())
90-
@info "Deprecated, please use GraphsDFG or LightDFG."
91-
nodesize = [has_prop(dfg.g,i,:factor) ? p.nodesize.fac : p.nodesize.var for i=vertices(dfg.g)]
92-
if p.drawlabels
93-
nodelabel = [has_prop(dfg.g,i,:factor) ? "" : string(get_prop(dfg.g,i,:label)) for i=vertices(dfg.g)]
94-
else
95-
nodelabel = nothing
96-
end
97-
nodefillc = [has_prop(dfg.g,i,:factor) ? p.nodefillc.fac : p.nodefillc.var for i=vertices(dfg.g)]
98-
99-
gplot(dfg.g, nodelabel=nodelabel, nodesize=nodesize, nodefillc=nodefillc, layout=p.layout)
100-
101-
end
102-
103-
"""
104-
$(SIGNATURES)
105-
Plots the structure of the factor graph. GraphPlot must be imported before DistributedFactoGraphs for these functions to be available.
106-
Returns the plot context.
107-
108-
E.g.
109-
```
110-
using GraphPlot
111-
using DistributedFactorGraphs, DistributedFactorGraphs.DFGPlots
112-
# ... Make graph...
113-
# Using GraphViz plotting
114-
dfgplot(fg)
115-
# Save to PDFG
116-
using Compose
117-
draw(PDF("/tmp/graph.pdf", 16cm, 16cm), dfgplot(fg))
118-
```
119-
12086
More information at [GraphPlot.jl](https://github.com/JuliaGraphs/GraphPlot.jl)
12187
"""
12288
function dfgplot(dfg::AbstractDFG, p::DFGPlotProps = DFGPlotProps())
@@ -128,11 +94,6 @@ function dfgplot(dfg::AbstractDFG, p::DFGPlotProps = DFGPlotProps())
12894
dfgplot(ldfg, p)
12995
end
13096

131-
function gplot(dfg::DistributedFactorGraphs.MetaGraphsDFG; keyargs...)
132-
@info "Deprecated, please use GraphsDFG or LightDFG."
133-
gplot(dfg.g; keyargs...)
134-
end
135-
13697
function gplot(dfg::LightDFG; keyargs...)
13798
gplot(dfg.g; keyargs...)
13899
end

src/DistributedFactorGraphs.jl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ using Reexport
99
using JSON2
1010
using LinearAlgebra
1111
using SparseArrays
12+
# This is used in the definition of getAdjacencyMatrixSparse
13+
using LightGraphs
1214

1315
# Entities
1416
include("entities/AbstractDFG.jl")
@@ -86,9 +88,6 @@ include("GraphsDFG/GraphsDFG.jl")
8688
# Include the FilesDFG API.
8789
include("FileDFG/FileDFG.jl")
8890

89-
# Include the LightGraphs.jl (MetaGraphs.jl) API.
90-
include("MetaGraphsDFG/MetaGraphsDFG.jl")
91-
9291
include("SymbolDFG/SymbolDFG.jl")
9392
using .SymbolDFGs
9493

src/SymbolDFG/services/SymbolDFG.jl

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -485,38 +485,6 @@ function getAdjacencyMatrixSparse(dfg::SymbolDFG)::Tuple{LightGraphs.SparseMatri
485485
end
486486
return adjMat, varLabels, factLabels
487487
end
488-
#=
489-
"""
490-
$(SIGNATURES)
491-
Produces a dot-format of the graph for visualization.
492-
"""
493-
function toDot(dfg::SymbolDFG)::String
494-
@error "toDot(dfg::SymbolDFG) is not sopported yet, see https://github.com/JuliaGraphs/MetaGraphs.jl/issues/86"
495-
m = PipeBuffer()
496-
MetaGraphs.savedot(m, dfg.g)
497-
data = take!(m)
498-
close(m)
499-
return String(data)
500-
end
501-
502-
"""
503-
$(SIGNATURES)
504-
Produces a dot file of the graph for visualization.
505-
Download XDot to see the data
506-
507-
Note
508-
- Default location "/tmp/dfg.dot" -- MIGHT BE REMOVED
509-
- Can be viewed with the `xdot` system application.
510-
- Based on graphviz.org
511-
"""
512-
function toDotFile(dfg::SymbolDFG, fileName::String="/tmp/dfg.dot")::Nothing
513-
@error "toDotFile(dfg::SymbolDFG,filename) is not sopported yet, see https://github.com/JuliaGraphs/MetaGraphs.jl/issues/86"
514-
open(fileName, "w") do fid
515-
MetaGraphs.savedot(fid, dfg.g)
516-
end
517-
return nothing
518-
end
519-
=#
520488

521489
"""
522490
$(SIGNATURES)

src/attic/MetaGraphsDFG/DFGPlots.jl

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
"""
2+
$(SIGNATURES)
3+
Plots the structure of the factor graph. GraphPlot must be imported before DistributedFactoGraphs for these functions to be available.
4+
Returns the plot context.
5+
6+
E.g.
7+
```
8+
using GraphPlot
9+
using DistributedFactorGraphs, DistributedFactorGraphs.DFGPlots
10+
# ... Make graph...
11+
# Using GraphViz plotting
12+
dfgplot(fg)
13+
# Save to PDFG
14+
using Compose
15+
draw(PDF("/tmp/graph.pdf", 16cm, 16cm), dfgplot(fg))
16+
```
17+
18+
More information at [GraphPlot.jl](https://github.com/JuliaGraphs/GraphPlot.jl)
19+
"""
20+
function dfgplot(dfg::DistributedFactorGraphs.MetaGraphsDFG, p::DFGPlotProps = DFGPlotProps())
21+
@info "Deprecated, please use GraphsDFG or LightDFG."
22+
nodesize = [has_prop(dfg.g,i,:factor) ? p.nodesize.fac : p.nodesize.var for i=vertices(dfg.g)]
23+
if p.drawlabels
24+
nodelabel = [has_prop(dfg.g,i,:factor) ? "" : string(get_prop(dfg.g,i,:label)) for i=vertices(dfg.g)]
25+
else
26+
nodelabel = nothing
27+
end
28+
nodefillc = [has_prop(dfg.g,i,:factor) ? p.nodefillc.fac : p.nodefillc.var for i=vertices(dfg.g)]
29+
30+
gplot(dfg.g, nodelabel=nodelabel, nodesize=nodesize, nodefillc=nodefillc, layout=p.layout)
31+
32+
end
33+
34+
function gplot(dfg::DistributedFactorGraphs.MetaGraphsDFG; keyargs...)
35+
@info "Deprecated, please use GraphsDFG or LightDFG."
36+
gplot(dfg.g; keyargs...)
37+
end

src/MetaGraphsDFG/MetaGraphsDFG.jl renamed to src/attic/MetaGraphsDFG/MetaGraphsDFG.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ using MetaGraphs
44
# Imports
55
include("entities/MetaGraphsDFG.jl")
66
include("services/MetaGraphsDFG.jl")
7+
include("DFGPlots.jl")
78

89
# Exports
910
# Deprecated -

src/entities/DFGVariable.jl

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,18 @@ mutable struct VariableNodeData{T<:InferenceVariable}
2525

2626
end
2727

28-
VariableNodeData(val::Array{Float64,2},bw::Array{Float64,2},BayesNetOutVertIDs::Array{Symbol,1},dimIDs::Array{Int,1},dims::Int,eliminated::Bool,BayesNetVertID::Symbol,separator::Array{Symbol,1},softtype::T,initialized::Bool,inferdim::Float64,ismargin::Bool,dontmargin::Bool) where T <: InferenceVariable = VariableNodeData{T}(val,bw,BayesNetOutVertIDs,dimIDs,dims,eliminated,BayesNetVertID,separator,softtype::T,initialized,inferdim,ismargin,dontmargin)
28+
VariableNodeData(val::Array{Float64,2},
29+
bw::Array{Float64,2},
30+
BayesNetOutVertIDs::Array{Symbol,1},
31+
dimIDs::Array{Int,1},
32+
dims::Int,eliminated::Bool,
33+
BayesNetVertID::Symbol,
34+
separator::Array{Symbol,1},
35+
softtype::T,
36+
initialized::Bool,
37+
inferdim::Float64,
38+
ismargin::Bool,
39+
dontmargin::Bool) where T <: InferenceVariable = VariableNodeData{T}(val,bw,BayesNetOutVertIDs,dimIDs,dims,eliminated,BayesNetVertID,separator,softtype::T,initialized,inferdim,ismargin,dontmargin)
2940

3041
function VariableNodeData()
3142
st = stacktrace()

test/runtests.jl

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,8 @@ using Pkg
1515
# global_logger(logger)
1616

1717
# Test each interface
18-
# Still test LightDFG and MetaGraphsDFG for the moment until we remove in 0.4.2
1918
apis = [
2019
GraphsDFG,
21-
DistributedFactorGraphs.MetaGraphsDFG,
2220
DistributedFactorGraphs.SymbolDFG,
2321
LightDFG]
2422
for api in apis
@@ -29,10 +27,8 @@ for api in apis
2927
end
3028
end
3129

32-
# Test that we don't export LightDFG and MetaGraphsDFG
3330
@testset "Deprecated Drivers Test" begin
3431
@test_throws UndefVarError SymbolDFG{NoSolverParams}()
35-
@test_throws UndefVarError MetaGraphsDFG{NoSolverParams}()
3632
end
3733

3834
# Test special cases
@@ -66,7 +62,6 @@ if get(ENV, "IIF_TEST", "") == "true"
6662
apis = [
6763
GraphsDFG{NoSolverParams}(),
6864
LightDFG{NoSolverParams}(),
69-
# # DistributedFactorGraphs.MetaGraphsDFG{NoSolverParams}(),
7065
# # DistributedFactorGraphs.SymbolDFG{NoSolverParams}(),
7166
CloudGraphsDFG{SolverParams}("localhost", 7474, "neo4j", "test",
7267
"testUser", "testRobot", "testSession",

0 commit comments

Comments
 (0)