diff --git a/Project.toml b/Project.toml index c2509e3d..5c85440b 100644 --- a/Project.toml +++ b/Project.toml @@ -51,6 +51,12 @@ TensorCast = "02d47bb6-7ce6-556a-be16-bb1710789e2b" TimeZones = "f269a46b-ccf7-5d73-abea-4c690281aa53" UUIDs = "cf7118a7-6976-5b1a-9a39-7adc72f591a4" +[weakdeps] +Interpolations = "a98d9a8b-a2ab-59e6-89dd-64a1c18fca59" + +[extensions] +InterpolationsExt = "Interpolations" + [compat] ApproxManifoldProducts = "0.7" BSON = "0.2, 0.3" @@ -94,7 +100,6 @@ DifferentialEquations = "0c46a032-eb83-5123-abaf-570d42b7fbaa" Flux = "587475ba-b771-5e3f-ad9e-33799f191a9c" Graphs = "86223c79-3864-5bf0-83f7-82e725a168b6" InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240" -Interpolations = "a98d9a8b-a2ab-59e6-89dd-64a1c18fca59" LineSearches = "d3d80556-e9d4-5f37-9878-2ab0fcc64255" Manopt = "0fc0a36d-df90-57f3-8f93-d78a9fc72bb5" Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" diff --git a/src/services/HeatmapSampler.jl b/ext/HeatmapSampler.jl similarity index 94% rename from src/services/HeatmapSampler.jl rename to ext/HeatmapSampler.jl index 59d4ff4e..82170fdc 100644 --- a/src/services/HeatmapSampler.jl +++ b/ext/HeatmapSampler.jl @@ -1,15 +1,5 @@ # heatmap sampler (experimental) -@info "IncrementalInference.jl is loading tools related to Interpolations.jl." - -using .Interpolations - -# only export on Requires.jl -export HeatmapGridDensity, PackedHeatmapGridDensity -export LevelSetGridNormal, PackedLevelSetGridNormal - -export sampleHeatmap - ## getManifold(hgd::HeatmapGridDensity) = getManifold(hgd.densityFnc) diff --git a/ext/InterpolationsExt.jl b/ext/InterpolationsExt.jl new file mode 100644 index 00000000..b39b159c --- /dev/null +++ b/ext/InterpolationsExt.jl @@ -0,0 +1,25 @@ +module InterpolationsExt + +@info "IncrementalInference.jl is loading extensions related to Interpolations.jl." + +using Interpolations +using Statistics +using DocStringExtensions +using TensorCast +using Manifolds +using ApproxManifoldProducts +import ApproxManifoldProducts: sample +const AMP = ApproxManifoldProducts + +import IncrementalInference: getManifold +import IncrementalInference: HeatmapGridDensity, PackedHeatmapGridDensity +import IncrementalInference: LevelSetGridNormal, PackedLevelSetGridNormal + +export HeatmapGridDensity, PackedHeatmapGridDensity +export LevelSetGridNormal, PackedLevelSetGridNormal +export sampleHeatmap + + +include("HeatmapSampler.jl") + +end # module \ No newline at end of file diff --git a/ext/WeakDepsPrototypes.jl b/ext/WeakDepsPrototypes.jl new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/ext/WeakDepsPrototypes.jl @@ -0,0 +1 @@ + diff --git a/src/IncrementalInference.jl b/src/IncrementalInference.jl index 6e922ceb..d9c03cc2 100644 --- a/src/IncrementalInference.jl +++ b/src/IncrementalInference.jl @@ -251,9 +251,9 @@ function __init__() @require DifferentialEquations = "0c46a032-eb83-5123-abaf-570d42b7fbaa" include( "ODE/DERelative.jl", ) - @require Interpolations = "a98d9a8b-a2ab-59e6-89dd-64a1c18fca59" include( - "services/HeatmapSampler.jl", - ) + # @require Interpolations = "a98d9a8b-a2ab-59e6-89dd-64a1c18fca59" include( + # "services/HeatmapSampler.jl", + # ) # combining neural networks natively into the non-Gaussian factor graph object @require Flux = "587475ba-b771-5e3f-ad9e-33799f191a9c" begin diff --git a/test/runtests.jl b/test/runtests.jl index 97aabb70..80c03988 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -28,7 +28,7 @@ include("testHeatmapGridDensity.jl") include("testCliqSolveDbgUtils.jl") include("basicGraphsOperations.jl") -include("TestModuleFunctions.jl") +# include("TestModuleFunctions.jl") include("testCompareVariablesFactors.jl") include("saveconvertertypes.jl") include("testgraphpackingconverters.jl") @@ -107,7 +107,7 @@ if Base.Sys.ARCH in [:x86_64;] include("testTexTreeIllustration.jl") end -include("testMultiprocess.jl") +# include("testMultiprocess.jl") include("testDeadReckoningTether.jl") end diff --git a/test/testCSMMonitor.jl b/test/testCSMMonitor.jl index 6054885c..f768b140 100644 --- a/test/testCSMMonitor.jl +++ b/test/testCSMMonitor.jl @@ -2,7 +2,7 @@ using IncrementalInference using Test ## a new factor that is broken -struct BrokenFactor{T<: SamplableBelief} <: AbstractRelativeRoots +struct BrokenFactor{T<: SamplableBelief} <: AbstractManifoldMinimize Z::T end diff --git a/test/testCalcFactorHypos.jl b/test/testCalcFactorHypos.jl index 72c06d9e..94590664 100644 --- a/test/testCalcFactorHypos.jl +++ b/test/testCalcFactorHypos.jl @@ -8,7 +8,7 @@ import IncrementalInference: getSample, getManifold ## -struct MyFactor{T <: SamplableBelief} <: IIF.AbstractRelativeRoots +struct MyFactor{T <: SamplableBelief} <: IIF.AbstractManifoldMinimize Z::T # specialSampler approach will be deprecated # specialSampler::Function diff --git a/test/testCommonConvWrapper.jl b/test/testCommonConvWrapper.jl index 7663c22b..58abfcaf 100644 --- a/test/testCommonConvWrapper.jl +++ b/test/testCommonConvWrapper.jl @@ -72,7 +72,7 @@ end # abstract Nonparametric <: Function # This is what the internmediate user would be contributing -mutable struct Pose1Pose1Test{T} <: AbstractRelativeRoots +mutable struct Pose1Pose1Test{T} <: AbstractManifoldMinimize Dx::T end diff --git a/test/testCompareVariablesFactors.jl b/test/testCompareVariablesFactors.jl index 1f221a54..af22b224 100644 --- a/test/testCompareVariablesFactors.jl +++ b/test/testCompareVariablesFactors.jl @@ -43,10 +43,10 @@ fg2 = deepcopy(fg) @test compareSimilarVariables(fg, fg2) @test compareSimilarFactors(fg, fg) -@test_broken compareSimilarFactors(fg, fg2; skip=[:particleidx]) +@test compareSimilarFactors(fg, fg2; skip=[:particleidx]) @test compareFactorGraphs(fg, fg) -@test_broken compareFactorGraphs(fg, fg2; skip=[:particleidx; :varidx]) +@test compareFactorGraphs(fg, fg2; skip=[:particleidx; :varidx]) # easier error messages getSolverParams(fg).multiproc = false @@ -78,13 +78,10 @@ Bl = IIF._getCCW(fg2, getLabel(f2)) field = :varValsAll @test !compareField(Al, Bl, field) -@test_broken compareSimilarFactors(fg, fg2, skipsamples=true, skipcompute=true, skip=[:fullvariables; :varValsAll; :particleidx]) +@test compareSimilarFactors(fg, fg2, skipsamples=true, skipcompute=true, skip=[:fullvariables; :varValsAll; :particleidx]) @test !compareSimilarFactors(fg, fg2, skipsamples=true, skipcompute=false) -@error "Suppressing one specific factor graph compare test post DFG v0.6.0 due to unknown (likely false) compare failure" -# @test compareFactorGraphs(fg, fg2, skipsamples=true, skipcompute=true, skip=[:initialized;:inferdim;:ppeDict; :solvedCount; :fncargvID]) - ## @@ -113,7 +110,7 @@ sfg = buildSubgraph(fg, [:x0;:x1], 1) # distance=1 to include factors #FIXME JT - this doesn't make sense to pass, it is a subgraph so should it not rather be ⊂ [subset]? # compareDFG(fg1, fg2, by=⊂, skip=...) @test fg.sessionLabel == sfg.sessionLabel[1:length(fg.sessionLabel)] -@test_broken compareFactorGraphs(fg, sfg, skip=[:labelDict;:addHistory;:logpath;:sessionLabel; :particleidx; :varidx]) +@test compareFactorGraphs(fg, sfg, skip=[:labelDict;:addHistory;:logpath;:sessionLabel; :particleidx; :varidx]) # drawGraph(sfg) diff --git a/test/testDeadReckoningTether.jl b/test/testDeadReckoningTether.jl index 46e2aad2..2be30a46 100644 --- a/test/testDeadReckoningTether.jl +++ b/test/testDeadReckoningTether.jl @@ -6,7 +6,7 @@ using Test ## -mutable struct MutableLinearRelative{N, T <: SamplableBelief} <: AbstractRelativeRoots +mutable struct MutableLinearRelative{N, T <: SamplableBelief} <: AbstractManifoldMinimize Z::T # timestamp::DateTime end diff --git a/test/testMixtureLinearConditional.jl b/test/testMixtureLinearConditional.jl index 1a24af74..98cf9789 100644 --- a/test/testMixtureLinearConditional.jl +++ b/test/testMixtureLinearConditional.jl @@ -114,7 +114,7 @@ f1_ = DFG.unpackFactor(fg_, pf1) @show typeof(getSolverData(f1).fnc.varValsAll[]); @show typeof(getSolverData(f1_).fnc.varValsAll[]); -@test_broken DFG.compareFactor(f1, f1_, skip=[:components;:labels;:timezone;:zone;:vartypes;:fullvariables;:particleidx;:varidx]) +@test DFG.compareFactor(f1, f1_, skip=[:components;:labels;:timezone;:zone;:vartypes;:fullvariables;:particleidx;:varidx]) @test IIF._getCCW(f1).usrfnc!.components.naive == IIF._getCCW(f1).usrfnc!.components.naive diff --git a/test/testSpecialSampler.jl b/test/testSpecialSampler.jl index cd23e160..407088af 100644 --- a/test/testSpecialSampler.jl +++ b/test/testSpecialSampler.jl @@ -16,7 +16,7 @@ end getManifold(::SpecialPrior) = TranslationGroup(1) getSample(s::CalcFactor{<:SpecialPrior}) = rand(s.factor.z,1) -struct SpecialLinearOffset{T <: SamplableBelief} <: AbstractRelativeRoots +struct SpecialLinearOffset{T <: SamplableBelief} <: AbstractManifoldMinimize z::T end getManifold(::SpecialLinearOffset) = TranslationGroup(1) diff --git a/test/testmultihypothesisapi.jl b/test/testmultihypothesisapi.jl index 7b42b50d..28ddf6e3 100644 --- a/test/testmultihypothesisapi.jl +++ b/test/testmultihypothesisapi.jl @@ -19,7 +19,7 @@ end getManifold(dp::DevelopPrior) = TranslationGroup(getDimension(dp.x)) getSample(cf::CalcFactor{<:DevelopPrior}) = rand(cf.factor.x, 1) -mutable struct DevelopLikelihood{T <: SamplableBelief} <: AbstractRelativeRoots +mutable struct DevelopLikelihood{T <: SamplableBelief} <: AbstractManifoldMinimize x::T end