Skip to content

Commit f027f41

Browse files
committed
revert LinearRelative and update CI
1 parent 4588832 commit f027f41

File tree

7 files changed

+97
-109
lines changed

7 files changed

+97
-109
lines changed

.github/workflows/ci.yml

Lines changed: 33 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ on:
99

1010
jobs:
1111
test-stable:
12-
name: JL${{ matrix.version }} - ${{ matrix.arch }} - ${{ matrix.group }} - ${{ matrix.os }}
12+
name: Stable JL-${{ matrix.version }} - ${{ matrix.group }}
1313
runs-on: ${{ matrix.os }}
1414
env:
1515
JULIA_PKG_SERVER: ""
1616
strategy:
1717
fail-fast: false
1818
matrix:
1919
version:
20-
- '1.11'
20+
- 'lts'
2121
os:
2222
- ubuntu-latest
2323
arch:
@@ -26,26 +26,33 @@ jobs:
2626
- 'basic_functional_group'
2727
- 'test_cases_group'
2828
steps:
29-
- uses: actions/checkout@v2
29+
- uses: actions/checkout@v4
3030
- uses: julia-actions/setup-julia@v2
3131
with:
3232
version: ${{ matrix.version }}
3333
arch: ${{ matrix.arch }}
34-
- uses: julia-actions/cache@v1
34+
- uses: julia-actions/cache@v2
3535
- uses: julia-actions/julia-buildpkg@v1
36-
- uses: julia-actions/julia-runtest@v1
37-
continue-on-error: ${{ matrix.version == 'nightly' }}
36+
- name: Dev dependencies
37+
shell: julia --project=monorepo {0}
38+
run: |
39+
using Pkg;
40+
Pkg.develop([PackageSpec(path="IncrementalInference"), PackageSpec(path="IncrementalInferenceTypes")]);
41+
- name: Run tests
42+
continue-on-error: ${{ matrix.group == 'tmp_debug_group' }}
3843
env:
3944
IIF_TEST_GROUP: ${{ matrix.group }}
45+
run: >
46+
julia --color=yes --project=monorepo -e 'using Pkg; Pkg.test("IncrementalInference")'
4047
- uses: julia-actions/julia-processcoverage@v1
4148
- uses: codecov/codecov-action@v2
4249
with:
4350
files: lcov.info
4451
fail_ci_if_error: false
4552
if: ${{ matrix.version != 'nightly' }}
4653

47-
upstream-dev-functional:
48-
name: Upstr Dev Functional
54+
upstream-dev:
55+
name: Develop JL-${{ matrix.version }} - ${{ matrix.group }}
4956
runs-on: ubuntu-latest
5057
env:
5158
JULIA_PKG_SERVER: ""
@@ -55,105 +62,32 @@ jobs:
5562
arch:
5663
- x64
5764
version:
58-
- '~1.12.0-0'
65+
- '1'
5966
group:
6067
- 'basic_functional_group'
61-
steps:
62-
- uses: actions/checkout@v2
63-
- uses: julia-actions/setup-julia@v2
64-
with:
65-
version: ${{ matrix.version }}
66-
arch: ${{ matrix.arch }}
67-
- uses: actions/cache@v4
68-
env:
69-
cache-name: cache-artifacts
70-
with:
71-
path: ~/.julia/artifacts
72-
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
73-
restore-keys: |
74-
${{ runner.os }}-test-${{ env.cache-name }}-
75-
${{ runner.os }}-test-
76-
${{ runner.os }}-
77-
- run: |
78-
git config --global user.name Tester
79-
git config --global user.email te@st.er
80-
- name: Upst Dev Functional
81-
env:
82-
IIF_TEST_GROUP: ${{ matrix.group }}
83-
run: |
84-
julia --project=@. --check-bounds=yes -e 'using Pkg; Pkg.add(PackageSpec(name="ApproxManifoldProducts",rev="develop"));'
85-
julia --project=@. --check-bounds=yes -e 'using Pkg; Pkg.add(PackageSpec(name="DistributedFactorGraphs",rev="develop"));'
86-
julia --project=@. --check-bounds=yes -e 'using Pkg; Pkg.test("IncrementalInference"; coverage=false)'
87-
shell: bash
88-
89-
upstream-dev-cases:
90-
name: Upstr Dev Test Cases
91-
runs-on: ubuntu-latest
92-
env:
93-
JULIA_PKG_SERVER: ""
94-
strategy:
95-
fail-fast: false
96-
matrix:
97-
arch:
98-
- x64
99-
version:
100-
- '~1.12.0-0'
101-
group:
10268
- 'test_cases_group'
103-
steps:
104-
- uses: actions/checkout@v2
105-
- uses: julia-actions/setup-julia@v2
106-
with:
107-
version: ${{ matrix.version }}
108-
arch: ${{ matrix.arch }}
109-
- uses: actions/cache@v4
110-
env:
111-
cache-name: cache-artifacts
112-
with:
113-
path: ~/.julia/artifacts
114-
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
115-
restore-keys: |
116-
${{ runner.os }}-test-${{ env.cache-name }}-
117-
${{ runner.os }}-test-
118-
${{ runner.os }}-
119-
- run: |
120-
git config --global user.name Tester
121-
git config --global user.email te@st.er
122-
- name: Upstr Dev Cases
123-
env:
124-
IIF_TEST_GROUP: ${{ matrix.group }}
125-
run: |
126-
julia --project=@. --check-bounds=yes -e 'using Pkg; Pkg.add(PackageSpec(name="ApproxManifoldProducts",rev="develop"));'
127-
julia --project=@. --check-bounds=yes -e 'using Pkg; Pkg.add(PackageSpec(name="DistributedFactorGraphs",rev="develop"));'
128-
julia --project=@. --check-bounds=yes -e 'using Pkg; Pkg.test("IncrementalInference"; coverage=false)'
129-
shell: bash
130-
131-
test-debug-group:
132-
needs: [ upstream-dev-functional ]
133-
name: JL${{ matrix.version }} - ${{ matrix.group }} - ${{ matrix.os }}
134-
runs-on: ${{ matrix.os }}
135-
env:
136-
JULIA_PKG_SERVER: ""
137-
strategy:
138-
fail-fast: false
139-
matrix:
140-
os:
141-
- ubuntu-latest
142-
version:
143-
- '~1.12.0-0'
144-
arch:
145-
- x64
146-
group:
14769
- 'tmp_debug_group'
148-
continue-on-error: true
14970
steps:
150-
- uses: actions/checkout@v2
71+
- uses: actions/checkout@v4
15172
- uses: julia-actions/setup-julia@v2
15273
with:
15374
version: ${{ matrix.version }}
15475
arch: ${{ matrix.arch }}
155-
- uses: julia-actions/cache@v1
156-
- uses: julia-actions/julia-buildpkg@v1
157-
- uses: julia-actions/julia-runtest@v1
76+
- uses: julia-actions/cache@v2
77+
# - run: |
78+
# git config --global user.name Tester
79+
# git config --global user.email te@st.er
80+
- name: Dev dependencies
81+
shell: julia --project=monorepo {0}
82+
run: |
83+
using Pkg;
84+
Pkg.add(PackageSpec(name="DistributedFactorGraphs",rev="develop"))
85+
Pkg.add(PackageSpec(name="ApproxManifoldProducts",rev="develop"));
86+
Pkg.develop([PackageSpec(path="IncrementalInference"), PackageSpec(path="IncrementalInferenceTypes")]);
87+
- name: Run tests
88+
continue-on-error: ${{ matrix.group == 'tmp_debug_group' }}
15889
env:
15990
IIF_TEST_GROUP: ${{ matrix.group }}
91+
run: >
92+
julia --color=yes --project=monorepo -e 'using Pkg; Pkg.test("IncrementalInference")'
93+

IncrementalInference/src/Factors/LinearRelative.jl

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,40 @@
11

22
export LinearRelative, PackedLinearRelative
33

4+
"""
5+
$(TYPEDEF)
6+
7+
Default linear offset between two scalar variables.
8+
9+
```math
10+
X_2 = X_1 + η_Z
11+
```
12+
"""
13+
struct LinearRelative{N, T <: SamplableBelief} <: AbstractManifoldMinimize # AbstractRelativeMinimize
14+
Z::T
15+
end
16+
17+
# need several helper constructors since the dimension over which LinearRelative will be used is unknown at this point
18+
function LinearRelative{N}(
19+
z0::T = MvNormal(zeros(N), diagm(ones(N))),
20+
) where {N, T <: SamplableBelief}
21+
#
22+
return LinearRelative{N, T}(z0)
23+
end
24+
25+
function LinearRelative(::UniformScaling = LinearAlgebra.I)
26+
return LinearRelative{1}(MvNormal(zeros(1), diagm(ones(1))))
27+
end
28+
function LinearRelative(nm::Distributions.ContinuousUnivariateDistribution)
29+
return LinearRelative{1, typeof(nm)}(nm)
30+
end
31+
LinearRelative(nm::MvNormal) = LinearRelative{length(nm.μ), typeof(nm)}(nm)
32+
function LinearRelative(nm::Union{<:BallTreeDensity, <:ManifoldKernelDensity})
33+
return LinearRelative{Ndim(nm), typeof(nm)}(nm)
34+
end
35+
36+
getManifold(::InstanceType{LinearRelative{N}}) where {N} = getManifold(ContinuousEuclid{N})
37+
438
# TODO standardize
539
getDimension(::InstanceType{LinearRelative{N}}) where {N} = N
640

@@ -21,3 +55,24 @@ function Base.convert(
2155
return Manifolds.TranslationGroup(N)
2256
end
2357

58+
"""
59+
$(TYPEDEF)
60+
Serialization type for `LinearRelative` binary factor.
61+
"""
62+
Base.@kwdef mutable struct PackedLinearRelative <: AbstractPackedFactor
63+
Z::PackedSamplableBelief
64+
end
65+
function convert(::Type{PackedLinearRelative}, d::LinearRelative)
66+
return PackedLinearRelative(convert(PackedSamplableBelief, d.Z))
67+
end
68+
function convert(::Type{LinearRelative}, d::PackedLinearRelative)
69+
return LinearRelative(convert(SamplableBelief, d.Z))
70+
end
71+
function DFG.pack(d::LinearRelative)
72+
return PackedLinearRelative(DFG.packDistribution(d.Z))
73+
end
74+
function DFG.unpack(d::PackedLinearRelative)
75+
return LinearRelative(DFG.unpackDistribution(d.Z))
76+
end
77+
78+
#

IncrementalInference/src/services/EvalFactor.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ function evalPotentialSpecific(
345345
maxlen = _beforeSolveCCW!(ccwl, variables, sfidx, N; solveKey, needFreshMeasurements, measurement)
346346

347347
# Check which variables have been initialized
348-
isinit = map(x -> isInitialized(x), variables)
348+
isinit = map(x -> isInitialized(x, solveKey), variables)
349349

350350
# assemble how hypotheses should be computed
351351
# nullSurplus see #1517

IncrementalInference/test/basicGraphsOperations.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ end
2626
##
2727

2828
pts = [randn(1) for _ in 1:100]
29-
varT = LinearRelative{1}
29+
varT = LinearRelative(Normal(1.0))
3030
manikde!(varT, pts)
3131

3232

IncrementalInference/test/testSolveKey.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ IIF.setDefaultNodeData!(getVariable(fg, :a), 0, 100, 1, solveKey=:testSolveKey,
3232

3333
initVariable!(fg, :a, pts, :testSolveKey)
3434

35-
@test !isInitialized(fg, :a)
3635
@test isInitialized(fg, :a, :testSolveKey)
3736

3837
##

IncrementalInferenceTypes/Project.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
1515
StructTypes = "856f2bd8-1eba-4b0a-8007-ebc267875bd4"
1616

1717
[compat]
18-
Dates = "1.11.0"
19-
Distributed = "1.11.0"
18+
Dates = "1.10.0"
19+
Distributed = "1.10.0"
2020
DistributedFactorGraphs = "0.27.0"
2121
Distributions = "0.25.120"
2222
DocStringExtensions = "0.9.5"
23-
Manifolds = "=0.10.16"
23+
Manifolds = "0.10.16"
2424
RecursiveArrayTools = "3.33.0"
2525
StaticArrays = "1.9.13"
2626
StructTypes = "1.11.0"

IncrementalInferenceTypes/src/IncrementalInferenceTypes.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@ export
2020
Position4,
2121
ContinuousScalar,
2222
ContinuousEuclid,
23-
Ciruclar
23+
Circular
2424

2525
#export factor types
2626
export
2727
Prior,
2828
PackedPrior,
29-
LinearRelative,
30-
PackedLinearRelative,
29+
# LinearRelative,
30+
# PackedLinearRelative,
3131
CircularCircular,
3232
PriorCircular,
3333
PackedCircularCircular,
@@ -56,7 +56,7 @@ include("variables/DefaultVariableTypes.jl")
5656
# Factor Definitions
5757
include("factors/DefaultPrior.jl")
5858
#FIXME maybe upgrade linear relative to this
59-
include("factors/LinearRelative.jl")
59+
# include("factors/LinearRelative.jl")
6060
include("factors/Circular.jl")
6161

6262
# Distribution Serialization

0 commit comments

Comments
 (0)