Skip to content

Commit 5353d3a

Browse files
committed
2 parents ad045c6 + 35db02e commit 5353d3a

File tree

4 files changed

+17
-8
lines changed

4 files changed

+17
-8
lines changed

Project.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ JSON2 = "2535ab7d-5cd8-5a07-80ac-9b1792aadce3"
1313
LightGraphs = "093fc24a-ae57-5d10-9952-331d41423f4d"
1414
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
1515
MetaGraphs = "626554b9-1ddb-594c-aa3c-2596fe9399a5"
16-
Neo4j = "d2adbeaf-5838-5367-8a2f-e46d570981db"
1716
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
1817
Requires = "ae029012-a4dd-5104-9daa-d747884805df"
1918
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
@@ -30,6 +29,7 @@ julia = "0.7, 1"
3029
[extras]
3130
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
3231
GraphPlot = "a2cc645c-3eea-5389-862e-a155d0052231"
32+
Neo4j = "d2adbeaf-5838-5367-8a2f-e46d570981db"
3333

3434
[targets]
35-
test = ["Test", "GraphPlot"]
35+
test = ["Test", "GraphPlot", "Neo4j"]

src/CloudGraphsDFG/services/CloudGraphsDFG.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -789,11 +789,11 @@ end
789789

790790
function getAdjacencyMatrixSparse(dfg::CloudGraphsDFG)::Tuple{SparseMatrixCSC, Vector{Symbol}, Vector{Symbol}}
791791
varLabels = getVariableIds(dfg)
792-
factLabels = sort(getFactorIds(dfg))
793-
vDict = Dict(varLabels .=> [1:length(varLabels)...].+1)
794-
fDict = Dict(factLabels .=> [1:length(factLabels)...].+1)
792+
factLabels = getFactorIds(dfg)
793+
vDict = Dict(varLabels .=> [1:length(varLabels)...])
794+
fDict = Dict(factLabels .=> [1:length(factLabels)...])
795795

796-
adjMat = spzeros(Int, length(factLabels)+1, length(varLabels)+1)
796+
adjMat = spzeros(Int, length(factLabels), length(varLabels))
797797

798798
# Now ask for all relationships for this session graph
799799
loadtx = transaction(dfg.neo4jInstance.connection)

src/services/AbstractDFG.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -472,11 +472,11 @@ Notes:
472472
- used by both factor graph variable and Bayes tree clique logic.
473473
"""
474474
function isInitialized(var::DFGVariable; key::Symbol=:default)::Bool
475-
solverData(var, key) && return solverData(var, key).initialized
475+
solverData(var, key) != nothing && return solverData(var, key).initialized
476476
return false
477477
end
478478
function isInitialized(fct::DFGFactor; key::Symbol=:default)::Bool
479-
solverData(var, key) && return solverData(fct, key).initialized
479+
solverData(var, key) != nothing && return solverData(fct, key).initialized
480480
return false
481481
end
482482
function isInitialized(dfg::G, label::Symbol; key::Symbol=:default)::Bool where G <: AbstractDFG

test/interfaceTests.jl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,15 @@ end
107107

108108
@test getSolverParams(dfg) != nothing
109109
@test setSolverParams(dfg, getSolverParams(dfg)) == getSolverParams(dfg)
110+
111+
#solver data is initialized
112+
@test !isInitialized(dfg, :a)
113+
@test !isInitialized(v2)
114+
115+
#TODO Should the next test work?
116+
@test_broken !isInitialized(dfg, :f1)
117+
@test_broken !isInitialized(f1)
118+
110119
end
111120

112121
@testset "Updating Nodes" begin

0 commit comments

Comments
 (0)