Skip to content

Commit 1bf8488

Browse files
authored
Merge pull request #673 from JuliaRobotics/master
v0.10.6-rc1
2 parents b626fe4 + 198c588 commit 1bf8488

File tree

4 files changed

+20
-6
lines changed

4 files changed

+20
-6
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "DistributedFactorGraphs"
22
uuid = "b5cc3c7e-6572-11e9-2517-99fb8daf2f04"
3-
version = "0.10.5"
3+
version = "0.10.6"
44

55
[deps]
66
Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"

src/Common.jl

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,13 @@ _getname(t::T) where T = T.name.name
55

66

77
convertPackedType(t::Union{T, Type{T}}) where {T <: FunctorInferenceType} = getfield(_getmodule(t), Symbol("Packed$(_getname(t))"))
8-
convertStructType(::Type{PT}) where {PT <: PackedInferenceType} = getfield(PT.name.module, Symbol(string(PT.name.name)[7:end]))
9-
8+
function convertStructType(::Type{PT}) where {PT <: PackedInferenceType}
9+
# see #668 for expanded reasoning. PT may be ::UnionAll if the type is of template type.
10+
ptt = PT isa DataType ? PT.name.name : PT
11+
moduleName = PT isa DataType ? PT.name.module : Main
12+
symbolName = Symbol(string(ptt)[7:end])
13+
getfield(moduleName, symbolName)
14+
end
1015

1116
##==============================================================================
1217
## Sorting

src/DistributedFactorGraphs.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -306,8 +306,8 @@ if get(ENV, "DFG_USE_CGDFG", "") == "true"
306306
end
307307

308308
function __init__()
309-
@warn("BREAKING CHANGE v0.12: deprecating AbstractRelativeFactor, use AbstractRelativeRoots instead")
310-
@warn("BREAKING CHANGE v0.12: deprecating AbstractRelativeFactorMinimize, use AbstractRelativeMinimize instead")
309+
@warn("BREAKING CHANGE coming to DistributedFactorGraphs v0.12: deprecating AbstractRelativeFactor, use AbstractRelativeRoots instead")
310+
@warn("BREAKING CHANGE coming to DistributedFactorGraphs v0.12: deprecating AbstractRelativeFactorMinimize, use AbstractRelativeMinimize instead")
311311

312312
@require GraphPlot = "a2cc645c-3eea-5389-862e-a155d0052231" begin
313313
@info "Including Plots"

src/services/Serialization.jl

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,16 @@ function getTypeFromSerializationModule(softtypeString::String)
8484
else
8585
m = Main
8686
end
87-
return getfield(m, Symbol(split_st[end]))
87+
noparams = split(split_st[end], r"{")
88+
ret = if 1 < length(noparams)
89+
# fix #671, but does not work with specific module yet
90+
bidx = findfirst(r"{", split_st[end])[1]
91+
eval(Base.Meta.parse("Main.$(noparams[1])$(split_st[end][bidx:end])"))
92+
else
93+
getfield(m, Symbol(split_st[end]))
94+
end
95+
96+
return ret
8897

8998
catch ex
9099
@error "Unable to deserialize soft type $(softtypeString)"

0 commit comments

Comments
 (0)