Skip to content

Commit cc2705a

Browse files
authored
Merge pull request #1744 from JuliaRobotics/23Q3/ext/interpolatiosn
fix AbsRelRoots, InterpolationsExt
2 parents 1f1c2f4 + 13ba9d6 commit cc2705a

14 files changed

+48
-30
lines changed

Project.toml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,12 @@ TensorCast = "02d47bb6-7ce6-556a-be16-bb1710789e2b"
5151
TimeZones = "f269a46b-ccf7-5d73-abea-4c690281aa53"
5252
UUIDs = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"
5353

54+
[weakdeps]
55+
Interpolations = "a98d9a8b-a2ab-59e6-89dd-64a1c18fca59"
56+
57+
[extensions]
58+
InterpolationsExt = "Interpolations"
59+
5460
[compat]
5561
ApproxManifoldProducts = "0.7"
5662
BSON = "0.2, 0.3"
@@ -94,7 +100,6 @@ DifferentialEquations = "0c46a032-eb83-5123-abaf-570d42b7fbaa"
94100
Flux = "587475ba-b771-5e3f-ad9e-33799f191a9c"
95101
Graphs = "86223c79-3864-5bf0-83f7-82e725a168b6"
96102
InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
97-
Interpolations = "a98d9a8b-a2ab-59e6-89dd-64a1c18fca59"
98103
LineSearches = "d3d80556-e9d4-5f37-9878-2ab0fcc64255"
99104
Manopt = "0fc0a36d-df90-57f3-8f93-d78a9fc72bb5"
100105
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"

src/services/HeatmapSampler.jl renamed to ext/HeatmapSampler.jl

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,5 @@
11
# heatmap sampler (experimental)
22

3-
@info "IncrementalInference.jl is loading tools related to Interpolations.jl."
4-
5-
using .Interpolations
6-
7-
# only export on Requires.jl
8-
export HeatmapGridDensity, PackedHeatmapGridDensity
9-
export LevelSetGridNormal, PackedLevelSetGridNormal
10-
11-
export sampleHeatmap
12-
133
##
144

155
getManifold(hgd::HeatmapGridDensity) = getManifold(hgd.densityFnc)

ext/InterpolationsExt.jl

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
module InterpolationsExt
2+
3+
@info "IncrementalInference.jl is loading extensions related to Interpolations.jl."
4+
5+
using Interpolations
6+
using Statistics
7+
using DocStringExtensions
8+
using TensorCast
9+
using Manifolds
10+
using ApproxManifoldProducts
11+
import ApproxManifoldProducts: sample
12+
const AMP = ApproxManifoldProducts
13+
14+
import IncrementalInference: getManifold
15+
import IncrementalInference: HeatmapGridDensity, PackedHeatmapGridDensity
16+
import IncrementalInference: LevelSetGridNormal, PackedLevelSetGridNormal
17+
18+
export HeatmapGridDensity, PackedHeatmapGridDensity
19+
export LevelSetGridNormal, PackedLevelSetGridNormal
20+
export sampleHeatmap
21+
22+
23+
include("HeatmapSampler.jl")
24+
25+
end # module

ext/WeakDepsPrototypes.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

src/IncrementalInference.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -251,9 +251,9 @@ function __init__()
251251
@require DifferentialEquations = "0c46a032-eb83-5123-abaf-570d42b7fbaa" include(
252252
"ODE/DERelative.jl",
253253
)
254-
@require Interpolations = "a98d9a8b-a2ab-59e6-89dd-64a1c18fca59" include(
255-
"services/HeatmapSampler.jl",
256-
)
254+
# @require Interpolations = "a98d9a8b-a2ab-59e6-89dd-64a1c18fca59" include(
255+
# "services/HeatmapSampler.jl",
256+
# )
257257

258258
# combining neural networks natively into the non-Gaussian factor graph object
259259
@require Flux = "587475ba-b771-5e3f-ad9e-33799f191a9c" begin

test/runtests.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ include("testHeatmapGridDensity.jl")
2828
include("testCliqSolveDbgUtils.jl")
2929
include("basicGraphsOperations.jl")
3030

31-
include("TestModuleFunctions.jl")
31+
# include("TestModuleFunctions.jl")
3232
include("testCompareVariablesFactors.jl")
3333
include("saveconvertertypes.jl")
3434
include("testgraphpackingconverters.jl")
@@ -107,7 +107,7 @@ if Base.Sys.ARCH in [:x86_64;]
107107
include("testTexTreeIllustration.jl")
108108
end
109109

110-
include("testMultiprocess.jl")
110+
# include("testMultiprocess.jl")
111111
include("testDeadReckoningTether.jl")
112112
end
113113

test/testCSMMonitor.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ using IncrementalInference
22
using Test
33

44
## a new factor that is broken
5-
struct BrokenFactor{T<: SamplableBelief} <: AbstractRelativeRoots
5+
struct BrokenFactor{T<: SamplableBelief} <: AbstractManifoldMinimize
66
Z::T
77
end
88

test/testCalcFactorHypos.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import IncrementalInference: getSample, getManifold
88

99
##
1010

11-
struct MyFactor{T <: SamplableBelief} <: IIF.AbstractRelativeRoots
11+
struct MyFactor{T <: SamplableBelief} <: IIF.AbstractManifoldMinimize
1212
Z::T
1313
# specialSampler approach will be deprecated
1414
# specialSampler::Function

test/testCommonConvWrapper.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ end
7272

7373
# abstract Nonparametric <: Function
7474
# This is what the internmediate user would be contributing
75-
mutable struct Pose1Pose1Test{T} <: AbstractRelativeRoots
75+
mutable struct Pose1Pose1Test{T} <: AbstractManifoldMinimize
7676
Dx::T
7777
end
7878

test/testCompareVariablesFactors.jl

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@ fg2 = deepcopy(fg)
4343
@test compareSimilarVariables(fg, fg2)
4444

4545
@test compareSimilarFactors(fg, fg)
46-
@test_broken compareSimilarFactors(fg, fg2; skip=[:particleidx])
46+
@test compareSimilarFactors(fg, fg2; skip=[:particleidx])
4747

4848
@test compareFactorGraphs(fg, fg)
49-
@test_broken compareFactorGraphs(fg, fg2; skip=[:particleidx; :varidx])
49+
@test compareFactorGraphs(fg, fg2; skip=[:particleidx; :varidx])
5050

5151
# easier error messages
5252
getSolverParams(fg).multiproc = false
@@ -78,13 +78,10 @@ Bl = IIF._getCCW(fg2, getLabel(f2))
7878
field = :varValsAll
7979
@test !compareField(Al, Bl, field)
8080

81-
@test_broken compareSimilarFactors(fg, fg2, skipsamples=true, skipcompute=true, skip=[:fullvariables; :varValsAll; :particleidx])
81+
@test compareSimilarFactors(fg, fg2, skipsamples=true, skipcompute=true, skip=[:fullvariables; :varValsAll; :particleidx])
8282

8383
@test !compareSimilarFactors(fg, fg2, skipsamples=true, skipcompute=false)
8484

85-
@error "Suppressing one specific factor graph compare test post DFG v0.6.0 due to unknown (likely false) compare failure"
86-
# @test compareFactorGraphs(fg, fg2, skipsamples=true, skipcompute=true, skip=[:initialized;:inferdim;:ppeDict; :solvedCount; :fncargvID])
87-
8885

8986
##
9087

@@ -113,7 +110,7 @@ sfg = buildSubgraph(fg, [:x0;:x1], 1) # distance=1 to include factors
113110
#FIXME JT - this doesn't make sense to pass, it is a subgraph so should it not rather be ⊂ [subset]?
114111
# compareDFG(fg1, fg2, by=⊂, skip=...)
115112
@test fg.sessionLabel == sfg.sessionLabel[1:length(fg.sessionLabel)]
116-
@test_broken compareFactorGraphs(fg, sfg, skip=[:labelDict;:addHistory;:logpath;:sessionLabel; :particleidx; :varidx])
113+
@test compareFactorGraphs(fg, sfg, skip=[:labelDict;:addHistory;:logpath;:sessionLabel; :particleidx; :varidx])
117114

118115
# drawGraph(sfg)
119116

0 commit comments

Comments
 (0)