Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions src/services/Serialization.jl
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,21 @@
typeString = _typeString
end

all_subtypes = Dict(map(s -> nameof(s) => s, subtypes(InferenceVariable)))
split_typeSyms = Symbol.(split(typeString, "."))

subtype = get(all_subtypes, Symbol(split(typeString, ".")[end]), nothing)
subtype = nothing

if length(split_typeSyms) == 1
@warn "Module not found in variable '$typeString'." maxlog = 1
subtype = getfield(Main, split_typeSyms[1]) # no module specified, use Main

Check warning on line 64 in src/services/Serialization.jl

View check run for this annotation

Codecov / codecov/patch

src/services/Serialization.jl#L63-L64

Added lines #L63 - L64 were not covered by tests
#FIXME interm fallback for backwards compatibility in IIFTypes and RoMETypes
elseif split_typeSyms[1] in Symbol.(values(Base.loaded_modules))
m = getfield(Main, split_typeSyms[1])
subtype = getfield(m, split_typeSyms[end])
else
@warn "Module not found in Main, using Main for type '$typeString'." maxlog = 1
subtype = getfield(Main, split_typeSyms[end])

Check warning on line 71 in src/services/Serialization.jl

View check run for this annotation

Codecov / codecov/patch

src/services/Serialization.jl#L70-L71

Added lines #L70 - L71 were not covered by tests
end

if isnothing(subtype)
throw(SerializationError("Unable to deserialize type $(_typeString), not found"))
Expand Down
18 changes: 15 additions & 3 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,22 @@ end
if get(ENV, "IIF_TEST", "true") == "true"

# Switch to our upstream test branch.
#FIXME This is a temporary fix to use the develop branch of IIF.
# Pkg.add(PackageSpec(; name = "IncrementalInference", rev = "upstream/dfg_integration_test"))
# Pkg.add(PackageSpec(; name = "IncrementalInference", rev = "develop"))
Pkg.add(
#FIXME This is a temporary fix to use the refactored factor branch.
# PackageSpec(; name = "IncrementalInference", rev = "upstream/dfg_integration_test"),
PackageSpec(; name = "IncrementalInference", rev = "develop"),
PackageSpec(;
url = "https://github.com/JuliaRobotics/IncrementalInference.jl.git",
subdir = "IncrementalInferenceTypes",
rev = "develop",
),
)
Pkg.add(
PackageSpec(;
url = "https://github.com/JuliaRobotics/IncrementalInference.jl.git",
subdir = "IncrementalInference",
rev = "develop",
),
)
@info "------------------------------------------------------------------------"
@info "These tests are using IncrementalInference to do additional driver tests"
Expand Down
Loading