Skip to content

Commit 609b3b3

Browse files
authored
Merge pull request #104 from JuliaRobotics/feature/101_removingdataframes
Removing DataFrame references
2 parents c779acb + 6aafdf9 commit 609b3b3

File tree

11 files changed

+6
-95
lines changed

11 files changed

+6
-95
lines changed

Project.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ version = "0.4.0"
44

55
[deps]
66
Colors = "5ae59095-9a9b-59fe-a467-6f913c188581"
7-
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
87
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
98
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
109
DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"

docs/src/func_ref.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,3 @@ getSubgraph
6363
toDot
6464
toDotFile
6565
```
66-
67-
### DataFrame Extension Functions
68-
```@docs
69-
getAdjacencyMatrixDataFrame
70-
```

src/CloudGraphsDFG/CloudGraphsDFG.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ export getVariable, getFactor
2020
export updateVariable!, updateFactor!
2121
export deleteVariable!, deleteFactor!
2222
export getAdjacencyMatrix
23-
export getAdjacencyMatrixDataFrame
2423
export getNeighbors
2524
export getSubgraphAroundNode
2625
export getSubgraph

src/CloudGraphsDFG/services/CloudGraphsDFG.jl

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -815,30 +815,3 @@ end
815815
# end
816816
# return nothing
817817
# end
818-
#
819-
# function __init__()
820-
# @require DataFrames="a93c6f00-e57d-5684-b7b6-d8193f3e46c0" begin
821-
# if isdefined(Main, :DataFrames)
822-
# """
823-
# $(SIGNATURES)
824-
# Get an adjacency matrix for the DFG as a DataFrame.
825-
# Rows are all factors, columns are all variables, and each cell contains either nothing or the symbol of the relating factor.
826-
# The first column is the factor headings.
827-
# """
828-
# function getAdjacencyMatrixDataFrame(dfg::CloudGraphsDFG)::Main.DataFrames.DataFrame
829-
# varLabels = sort(map(v->v.label, getVariables(dfg)))
830-
# factLabels = sort(map(f->f.label, getFactors(dfg)))
831-
# adjDf = DataFrames.DataFrame(:Factor => Union{Missing, Symbol}[])
832-
# for varLabel in varLabels
833-
# adjDf[varLabel] = Union{Missing, Symbol}[]
834-
# end
835-
# for (i, factLabel) in enumerate(factLabels)
836-
# push!(adjDf, [factLabel, DataFrames.missings(length(varLabels))...])
837-
# factVars = getNeighbors(dfg, getFactor(dfg, factLabel))
838-
# map(vLabel -> adjDf[vLabel][i] = factLabel, factVars)
839-
# end
840-
# return adjDf
841-
# end
842-
# end
843-
# end
844-
# end

src/DistributedFactorGraphs.jl

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -60,31 +60,6 @@ include("LightDFG/LightDFG.jl")
6060
export saveDFG, loadDFG
6161

6262
function __init__()
63-
@require DataFrames="a93c6f00-e57d-5684-b7b6-d8193f3e46c0" begin
64-
if isdefined(Main, :DataFrames)
65-
"""
66-
$(SIGNATURES)
67-
Get an adjacency matrix for the DFG as a DataFrame.
68-
Rows are all factors, columns are all variables, and each cell contains either nothing or the symbol of the relating factor.
69-
The first column is the factor headings.
70-
"""
71-
function getAdjacencyMatrixDataFrame(dfg::Union{GraphsDFG, MetaGraphsDFG, SymbolDFG, LightDFG})::Main.DataFrames.DataFrame
72-
varLabels = sort(map(v->v.label, getVariables(dfg)))
73-
factLabels = sort(map(f->f.label, getFactors(dfg)))
74-
adjDf = DataFrames.DataFrame(:Factor => Union{Missing, Symbol}[])
75-
for varLabel in varLabels
76-
adjDf[varLabel] = Union{Missing, Symbol}[]
77-
end
78-
for (i, factLabel) in enumerate(factLabels)
79-
push!(adjDf, [factLabel, DataFrames.missings(length(varLabels))...])
80-
factVars = getNeighbors(dfg, getFactor(dfg, factLabel))
81-
map(vLabel -> adjDf[vLabel][i] = factLabel, factVars)
82-
end
83-
return adjDf
84-
end
85-
end
86-
end
87-
8863
@require Neo4j="d2adbeaf-5838-5367-8a2f-e46d570981db" begin
8964
# Include the Cloudgraphs API
9065
include("CloudGraphsDFG/CloudGraphsDFG.jl")

src/GraphsDFG/GraphsDFG.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ export getVariable, getFactor
1616
export updateVariable!, updateFactor!
1717
export deleteVariable!, deleteFactor!
1818
export getAdjacencyMatrix
19-
export getAdjacencyMatrixDataFrame
2019
export getNeighbors
2120
export getSubgraphAroundNode
2221
export getSubgraph

src/GraphsDFG/services/GraphsDFG.jl

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -527,30 +527,3 @@ function toDotFile(dfg::GraphsDFG, fileName::String="/tmp/dfg.dot")::Nothing
527527
end
528528
return nothing
529529
end
530-
531-
# function __init__()
532-
# @require DataFrames="a93c6f00-e57d-5684-b7b6-d8193f3e46c0" begin
533-
# if isdefined(Main, :DataFrames)
534-
# """
535-
# $(SIGNATURES)
536-
# Get an adjacency matrix for the DFG as a DataFrame.
537-
# Rows are all factors, columns are all variables, and each cell contains either nothing or the symbol of the relating factor.
538-
# The first column is the factor headings.
539-
# """
540-
# function getAdjacencyMatrixDataFrame(dfg::GraphsDFG)::Main.DataFrames.DataFrame
541-
# varLabels = sort(map(v->v.label, getVariables(dfg)))
542-
# factLabels = sort(map(f->f.label, getFactors(dfg)))
543-
# adjDf = DataFrames.DataFrame(:Factor => Union{Missing, Symbol}[])
544-
# for varLabel in varLabels
545-
# adjDf[varLabel] = Union{Missing, Symbol}[]
546-
# end
547-
# for (i, factLabel) in enumerate(factLabels)
548-
# push!(adjDf, [factLabel, DataFrames.missings(length(varLabels))...])
549-
# factVars = getNeighbors(dfg, getFactor(dfg, factLabel))
550-
# map(vLabel -> adjDf[vLabel][i] = factLabel, factVars)
551-
# end
552-
# return adjDf
553-
# end
554-
# end
555-
# end
556-
# end

src/MetaGraphsDFG/MetaGraphsDFG.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ export getVariable, getFactor
1717
export updateVariable!, updateFactor!
1818
export deleteVariable!, deleteFactor!
1919
export getAdjacencyMatrix, getAdjacencyMatrixSparse
20-
export getAdjacencyMatrixDataFrame
2120
export getNeighbors
2221
export getSubgraphAroundNode
2322
export getSubgraph

test/FileDFG.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
using Revise
21
using Test
32
using DistributedFactorGraphs
43
using IncrementalInference, RoME

test/interfaceTests.jl

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ v2 = DFGVariable(:b)
44
f1 = DFGFactor{Int, :Symbol}(:f1)
55

66
#add tags for filters
7-
append!(v1.tags,[:VARIABLE, :POSE])
7+
append!(v1.tags, [:VARIABLE, :POSE])
88
append!(v2.tags, [:VARIABLE, :LANDMARK])
99
append!(f1.tags, [:FACTOR])
1010

@@ -121,10 +121,6 @@ end
121121
# @test adjMat[1, 3] == 1
122122
@test symdiff(v_ll, [:a, :b, :orphan]) == Symbol[]
123123
@test symdiff(f_ll, [:f1, :f1, :f1]) == Symbol[]
124-
125-
# Dataframe
126-
adjDf = getAdjacencyMatrixDataFrame(dfg)
127-
@test size(adjDf) == (1,4)
128124
end
129125

130126
# Deletions

0 commit comments

Comments
 (0)