Skip to content

Commit 1ec840d

Browse files
committed
Fixes
1 parent cb69b73 commit 1ec840d

File tree

3 files changed

+42
-40
lines changed

3 files changed

+42
-40
lines changed

src/entities/DFGFactor.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ mutable struct DFGFactor{T, S} <: AbstractDFGFactor
4444
_internalId::Int64
4545
_variableOrderSymbols::Vector{Symbol}
4646
# TODO back to front ts and _internalId for legacy reasons
47-
DFGFactor{T, S}(label::Symbol, _internalId::Int64=0, ts::DateTime=now()) where {T, S} = new{T, S}(label, Symbol[], GenericFunctionNodeData{T, S}(), 0, ts, 0, Symbol[])
47+
DFGFactor{T, S}(label::Symbol, _internalId::Int64=0, timestamp::DateTime=now()) where {T, S} = new{T, S}(label, Symbol[], GenericFunctionNodeData{T, S}(), 0, timestamp, 0, Symbol[])
4848
# DFGFactor{T, S}(label::Symbol, _internalId::Int64) where {T, S} = new{T, S}(label, Symbol[], GenericFunctionNodeData{T, S}(), 0, now(), _internalId, Symbol[])
4949
end
5050

src/services/DFGFactor.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ function packFactor(dfg::G, f::DFGFactor)::Dict{String, Any} where G <: Abstract
88
# Construct the properties to save
99
props = Dict{String, Any}()
1010
props["label"] = string(f.label)
11+
props["timestamp"] = string(f.timestamp)
1112
props["tags"] = JSON2.write(f.tags)
1213
# Pack the node data
1314
fnctype = f.data.fnc.usrfnc!
@@ -32,6 +33,7 @@ end
3233

3334
function unpackFactor(dfg::G, packedProps::Dict{String, Any}, iifModule)::DFGFactor where G <: AbstractDFG
3435
label = packedProps["label"]
36+
timestamp = DateTime(packedProps["timestamp"])
3537
tags = JSON2.read(packedProps["tags"], Vector{Symbol})
3638

3739
data = packedProps["data"]
@@ -56,7 +58,7 @@ function unpackFactor(dfg::G, packedProps::Dict{String, Any}, iifModule)::DFGFac
5658
solvable = packedProps["solvable"]
5759

5860
# Rebuild DFGVariable
59-
factor = DFGFactor{typeof(fullFactor.fnc), Symbol}(Symbol(label))
61+
factor = DFGFactor{typeof(fullFactor.fnc), Symbol}(Symbol(label), 0, timestamp)
6062
factor.tags = tags
6163
factor.data = fullFactor
6264
factor._variableOrderSymbols = _variableOrderSymbols

test/runtests.jl

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -17,44 +17,44 @@ using Dates
1717
# global_logger(logger)
1818

1919
# Test each interface
20-
# apis = [
21-
# GraphsDFG,
22-
# DistributedFactorGraphs.SymbolDFG,
23-
# LightDFG
24-
# ]
25-
# for api in apis
26-
# @testset "Testing Driver: $(api)" begin
27-
# @info "Testing Driver: $(api)"
28-
# global testDFGAPI = api
29-
# include("interfaceTests.jl")
30-
# end
31-
# end
32-
#
33-
# @testset "Deprecated Drivers Test" begin
34-
# @test_throws UndefVarError SymbolDFG{NoSolverParams}()
35-
# end
36-
#
37-
# # Test special cases
38-
#
39-
# @testset "Plotting Tests" begin
40-
# include("plottingTest.jl")
41-
# end
42-
#
43-
# @testset "Data Store Tests" begin
44-
# include("DataStoreTests.jl")
45-
# end
46-
#
47-
#
48-
# @testset "LightDFG subtype tests" begin
49-
# for type in [(var=DFGVariableSummary, fac=DFGFactorSummary), (var=SkeletonDFGVariable,fac=SkeletonDFGFactor)]
50-
# @testset "$(type.var) and $(type.fac) tests" begin
51-
# @info "Testing $(type.var) and $(type.fac)"
52-
# global VARTYPE = type.var
53-
# global FACTYPE = type.fac
54-
# include("LightDFGSummaryTypes.jl")
55-
# end
56-
# end
57-
# end
20+
apis = [
21+
GraphsDFG,
22+
DistributedFactorGraphs.SymbolDFG,
23+
LightDFG
24+
]
25+
for api in apis
26+
@testset "Testing Driver: $(api)" begin
27+
@info "Testing Driver: $(api)"
28+
global testDFGAPI = api
29+
include("interfaceTests.jl")
30+
end
31+
end
32+
33+
@testset "Deprecated Drivers Test" begin
34+
@test_throws UndefVarError SymbolDFG{NoSolverParams}()
35+
end
36+
37+
# Test special cases
38+
39+
@testset "Plotting Tests" begin
40+
include("plottingTest.jl")
41+
end
42+
43+
@testset "Data Store Tests" begin
44+
include("DataStoreTests.jl")
45+
end
46+
47+
48+
@testset "LightDFG subtype tests" begin
49+
for type in [(var=DFGVariableSummary, fac=DFGFactorSummary), (var=SkeletonDFGVariable,fac=SkeletonDFGFactor)]
50+
@testset "$(type.var) and $(type.fac) tests" begin
51+
@info "Testing $(type.var) and $(type.fac)"
52+
global VARTYPE = type.var
53+
global FACTYPE = type.fac
54+
include("LightDFGSummaryTypes.jl")
55+
end
56+
end
57+
end
5858

5959
if get(ENV, "IIF_TEST", "") == "true"
6060

0 commit comments

Comments
 (0)