Skip to content

Commit 3cc06db

Browse files
authored
Rename light graphs (#87)
* LightGraphsDFG -> MetaGraphsDFG name change It makes more sense as a name and makes space for LightDFG name (directly based on LightGraphs).
1 parent f83af79 commit 3cc06db

File tree

8 files changed

+66
-66
lines changed

8 files changed

+66
-66
lines changed

src/CloudGraphsDFG/services/CloudGraphsDFG.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -720,7 +720,7 @@ function getSubgraphAroundNode(dfg::CloudGraphsDFG, node::DFGNode, distance::Int
720720
return addToDFG
721721
end
722722

723-
function getSubgraphAroundNode(dfg::CloudGraphsDFG{<:AbstractParams}, node::DFGNode, distance::Int64, includeOrphanFactors::Bool, addToDFG::LightGraphsDFG{AbstractParams})::AbstractDFG
723+
function getSubgraphAroundNode(dfg::CloudGraphsDFG{<:AbstractParams}, node::DFGNode, distance::Int64, includeOrphanFactors::Bool, addToDFG::MetaGraphsDFG{AbstractParams})::AbstractDFG
724724
distance < 1 && error("getSubgraphAroundNode() only works for distance > 0")
725725

726726

src/DFGPlots/DFGPlots.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ DFGPlotProps() = DFGPlotProps( (var=colorant"seagreen", fac=colorant"cyan3"),
2828
true)
2929

3030

31-
function dfgplot(dfg::LightGraphsDFG)
31+
function dfgplot(dfg::MetaGraphsDFG)
3232

3333
nodesize = [has_prop(dfg.g,i,:factor) ? 0.3 : 1.0 for i=vertices(dfg.g)]
3434
nodelabel = [has_prop(dfg.g,i,:factor) ? "" : string(get_prop(dfg.g,i,:label)) for i=vertices(dfg.g)]
@@ -38,14 +38,14 @@ function dfgplot(dfg::LightGraphsDFG)
3838

3939
end
4040

41-
function gplot(dfg::LightGraphsDFG; keyargs...)
41+
function gplot(dfg::MetaGraphsDFG; keyargs...)
4242
gplot(dfg.g; keyargs...)
4343
end
4444

4545
function dfgplot(dfg::AbstractDFG)
4646
# TODO implement convert functions
4747
@warn "TODO Implement convert"
48-
ldfg = LightGraphsDFG{AbstractParams}()
48+
ldfg = MetaGraphsDFG{AbstractParams}()
4949
DistributedFactorGraphs._copyIntoGraph!(dfg, ldfg, union(getVariableIds(dfg), getFactorIds(dfg)), true)
5050

5151
nodesize = [has_prop(ldfg.g,i,:factor) ? 0.3 : 1.0 for i=vertices(ldfg.g)]

src/DistributedFactorGraphs.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ include("GraphsDFG/GraphsDFG.jl")
5050
include("FileDFG/FileDFG.jl")
5151

5252
# Include the LightGraphs.jl (MetaGraphs.jl) API.
53-
include("LightGraphsDFG/LightGraphsDFG.jl")
53+
include("MetaGraphsDFG/MetaGraphsDFG.jl")
5454

5555
include("SymbolDFG/SymbolDFG.jl")
5656
@reexport using .SymbolDFGs
@@ -69,7 +69,7 @@ function __init__()
6969
Rows are all factors, columns are all variables, and each cell contains either nothing or the symbol of the relating factor.
7070
The first column is the factor headings.
7171
"""
72-
function getAdjacencyMatrixDataFrame(dfg::Union{GraphsDFG, LightGraphsDFG, SymbolDFG, LightDFG})::Main.DataFrames.DataFrame
72+
function getAdjacencyMatrixDataFrame(dfg::Union{GraphsDFG, MetaGraphsDFG, SymbolDFG, LightDFG})::Main.DataFrames.DataFrame
7373
varLabels = sort(map(v->v.label, getVariables(dfg)))
7474
factLabels = sort(map(f->f.label, getFactors(dfg)))
7575
adjDf = DataFrames.DataFrame(:Factor => Union{Missing, Symbol}[])

src/LightGraphsDFG/LightGraphsDFG.jl renamed to src/MetaGraphsDFG/MetaGraphsDFG.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ using LightGraphs
22
using MetaGraphs
33

44
# Imports
5-
include("entities/LightGraphsDFG.jl")
6-
include("services/LightGraphsDFG.jl")
5+
include("entities/MetaGraphsDFG.jl")
6+
include("services/MetaGraphsDFG.jl")
77

88
# Exports
9-
export LightGraphsDFG
9+
export MetaGraphsDFG
1010
export exists
1111
export getLabelDict, getDescription, setDescription, getInnerGraph, getAddHistory, getSolverParams, setSolverParams
1212
#

src/LightGraphsDFG/entities/LightGraphsDFG.jl renamed to src/MetaGraphsDFG/entities/MetaGraphsDFG.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ end
1010

1111
const LFGType = MetaGraph{Int64,Float64}
1212

13-
mutable struct LightGraphsDFG{T <: AbstractParams} <: AbstractDFG
13+
mutable struct MetaGraphsDFG{T <: AbstractParams} <: AbstractDFG
1414
g::LFGType
1515
description::String
1616
userId::String
@@ -25,7 +25,7 @@ mutable struct LightGraphsDFG{T <: AbstractParams} <: AbstractDFG
2525
end
2626

2727
#TODO? do we not want props such as userId, robotId, sessionId, etc...
28-
function LightGraphsDFG{T}(g::LFGType=MetaGraph();
28+
function MetaGraphsDFG{T}(g::LFGType=MetaGraph();
2929
description::String="LightGraphs.jl implementation",
3030
userId::String="User ID",
3131
robotId::String="Robot ID",
@@ -36,14 +36,14 @@ function LightGraphsDFG{T}(g::LFGType=MetaGraph();
3636
set_prop!(g, :robotId, robotId)
3737
set_prop!(g, :sessionId, sessionId)
3838
set_indexing_prop!(g, :label)
39-
LightGraphsDFG{T}(g, description, userId, robotId, sessionId, Symbol[], params)
39+
MetaGraphsDFG{T}(g, description, userId, robotId, sessionId, Symbol[], params)
4040
end
4141

42-
Base.propertynames(x::LightGraphsDFG, private::Bool=false) =
42+
Base.propertynames(x::MetaGraphsDFG, private::Bool=false) =
4343
(:g, :description, :userId, :robotId, :sessionId, :nodeCounter, :labelDict, :addHistory, :solverParams)
4444
# (private ? fieldnames(typeof(x)) : ())...)
4545

46-
Base.getproperty(x::LightGraphsDFG,f::Symbol) = begin
46+
Base.getproperty(x::MetaGraphsDFG,f::Symbol) = begin
4747
if f == :nodeCounter
4848
nv(x.g)
4949
elseif f == :labelDict
@@ -63,4 +63,4 @@ struct LightGraphsSkeleton
6363
labels::Dict{Symbol, Int}
6464
end
6565

66-
LightGraphsSkeleton(dfg::LightGraphsDFG) = LightGraphsSkeleton(dfg.g.graph, dfg.g.metaindex[:label])
66+
LightGraphsSkeleton(dfg::MetaGraphsDFG) = LightGraphsSkeleton(dfg.g.graph, dfg.g.metaindex[:label])

0 commit comments

Comments
 (0)