Skip to content

Commit ce05c84

Browse files
authored
Merge pull request #859 from JuliaRobotics/22Q1/maint/depr
fix depr api
2 parents 721eab7 + 74979b8 commit ce05c84

File tree

3 files changed

+30
-19
lines changed

3 files changed

+30
-19
lines changed

src/services/CustomPrinting.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ function printVariable( io::IO, vert::DFGVariable;
7373
end
7474
printstyled(ioc, " VariableType: ", color=:blue, bold=true)
7575
println(ioc, vari)
76-
# println(ioc, "kde max: $(round.(getKDEMax(getKDE(vnd)),digits=4))")
77-
# println(ioc, "kde max: $(round.(getKDEMax(getKDE(vnd)),digits=4))")
76+
# println(ioc, "kde max: $(round.(getKDEMax(getBelief(vnd)),digits=4))")
77+
# println(ioc, "kde max: $(round.(getKDEMax(getBelief(vnd)),digits=4))")
7878
else
7979

8080
printstyled(ioc, summary(vert), bold=true, color=:blue)

src/services/Serialization.jl

Lines changed: 27 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -379,22 +379,33 @@ function unpackFactor(dfg::G, packedProps::Dict{String, Any}) where G <: Abstrac
379379
# Parse it
380380
timestamp = ZonedDateTime(packedProps["timestamp"])
381381
nstime = Nanosecond(get(packedProps, "nstime", 0))
382-
if packedProps["tags"] isa String
383-
tags = JSON2.read(packedProps["tags"], Vector{Symbol})
384-
else
385-
tags = Symbol.(packedProps["tags"])
386-
# If tags is empty we need to make sure it's a Vector{Symbol}
387-
if length(tags) == 0
388-
tags = Vector{Symbol}()
389-
end
390-
end
391-
392-
# Get the stored variable order
393-
_variableOrderSymbols = if packedProps["_variableOrderSymbols"] isa String
394-
JSON2.read(packedProps["_variableOrderSymbols"], Vector{Symbol})
395-
else
396-
Symbol.(packedProps["_variableOrderSymbols"])
397-
end
382+
383+
_vecSymbol(vecstr) = Symbol[map(x->Symbol(x),vecstr)...]
384+
385+
# Get the stored tags and variable order
386+
@assert !(packedProps["tags"] isa String) "unpackFactor expecting JSON only data, packed `tags` should be a vector of strings (not a single string of elements)."
387+
@assert !(packedProps["_variableOrderSymbols"] isa String) "unpackFactor expecting JSON only data, packed `_variableOrderSymbols` should be a vector of strings (not a single string of elements)."
388+
tags = _vecSymbol(packedProps["tags"])
389+
_variableOrderSymbols = _vecSymbol(packedProps["_variableOrderSymbols"])
390+
# if packedProps["tags"] isa String
391+
# # TODO, legacy and should be removed
392+
# tags = JSON2.read(packedProps["tags"], Vector{Symbol})
393+
# else
394+
# # the preferred (and should be only) solution
395+
# tags = Symbol.(packedProps["tags"])
396+
# # If tags is empty we need to make sure it's a Vector{Symbol}
397+
# if length(tags) == 0
398+
# tags = Vector{Symbol}()
399+
# end
400+
# end
401+
# # Get the stored variable order
402+
# _variableOrderSymbols = if packedProps["_variableOrderSymbols"] isa String
403+
# # TODO, legacy and should be removed
404+
# JSON2.read(packedProps["_variableOrderSymbols"], Vector{Symbol})
405+
# else
406+
# # the preferred (and should be only) solution
407+
# Symbol.(packedProps["_variableOrderSymbols"])
408+
# end
398409

399410
data = packedProps["data"]
400411
datatype = packedProps["fnctype"]

test/attic/HexagonalCloud.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ for variable in getVariables(localFg)
5656
# variable.ppeDict[:default] = Dict{Symbol, VariableEstimate}(:Mean => VariableEstimate(:default, :Mean, means, now()))
5757
end
5858

59-
bel = getKDE(getVariable(localFg, :x0))
59+
bel = getBelief(getVariable(localFg, :x0))
6060
bel
6161

6262
# Push updates back to cloud.

0 commit comments

Comments
 (0)