Skip to content

Commit d28c8e1

Browse files
authored
Merge pull request #754 from JuliaRobotics/21Q2/enh/getmanifolds
remove getManifolds
2 parents b9fc5a1 + 99bf6cc commit d28c8e1

File tree

5 files changed

+24
-23
lines changed

5 files changed

+24
-23
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.13.1"
3+
version = "0.13.2"
44

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

src/services/DFGVariable.jl

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -74,14 +74,14 @@ Interface function to return the `<:ManifoldsBase.Manifold` object of `variableT
7474
"""
7575
function getManifold end
7676

77-
"""
78-
$SIGNATURES
79-
Interface function to return the `variableType` manifolds of an InferenceVariable, extend this function for all Types<:InferenceVariable.
80-
"""
81-
function getManifolds end
77+
# """
78+
# $SIGNATURES
79+
# Interface function to return the `variableType` manifolds of an InferenceVariable, extend this function for all Types<:InferenceVariable.
80+
# """
81+
# function getManifolds end
8282

83-
getManifolds(::Type{<:T}) where {T <: ManifoldsBase.Manifold} = convert(Tuple, T)
84-
getManifolds(::T) where {T <: ManifoldsBase.Manifold} = getManifolds(T)
83+
# getManifolds(::Type{<:T}) where {T <: ManifoldsBase.Manifold} = convert(Tuple, T)
84+
# getManifolds(::T) where {T <: ManifoldsBase.Manifold} = getManifolds(T)
8585

8686
getDimension(t_::T) where {T <: ManifoldsBase.Manifold} = manifold_dimension(t_)
8787

@@ -106,15 +106,15 @@ macro defVariable(structname, manifold)
106106
# user manifold must be a <:Manifold
107107
Base.convert(::Type{<:Manifold}, ::Union{<:T, Type{<:T}}) where {T <: $structname} = $manifold
108108

109-
DFG.getManifold(::Type{M}) where {M <: $structname} = $manifold
110-
DFG.getManifold(::M) where {M <: $structname} = getManifold(M)
109+
getManifold(::Type{M}) where {M <: $structname} = $manifold
110+
getManifold(::M) where {M <: $structname} = getManifold(M)
111111

112112
DFG.getDimension(::Type{M}) where {M <: $structname} = manifold_dimension(getManifold(M))
113113
DFG.getDimension(::M) where {M <: $structname} = manifold_dimension(getManifold(M))
114114

115-
# # FIXME legacy API to be deprecated
116-
DFG.getManifolds(::Type{M}) where {M <: $structname} = convert(Tuple, $manifold)
117-
DFG.getManifolds(::M) where {M <: $structname} = convert(Tuple, $manifold)
115+
# # # FIXME legacy API to be deprecated
116+
# DFG.getManifolds(::Type{M}) where {M <: $structname} = convert(Tuple, $manifold)
117+
# DFG.getManifolds(::M) where {M <: $structname} = convert(Tuple, $manifold)
118118
end)
119119
end
120120

test/runtests.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ using UUIDs
2121
# logger = SimpleLogger(stdout, Logging.Debug)
2222
# global_logger(logger)
2323

24-
@testset "Check @defVariable design" begin
25-
include("test_defVariable.jl")
26-
end
24+
# @testset "Check @defVariable design" begin
25+
# include("test_defVariable.jl")
26+
# end
2727

2828
include("testBlocks.jl")
2929

test/testBlocks.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ function DFGVariableSCA()
299299
#variableType functions
300300
testvar = TestVariableType1()
301301
@test getDimension(testvar) == 1
302-
@test getManifolds(testvar) == (:Euclid,)
302+
@test getManifold(testvar) == Euclidean(1)
303303

304304
# #TODO sort out
305305
# getPPEs

test/test_defVariable.jl

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Base.convert(::Type{<:Tuple}, ::typeof(Euclidean(2))) = (:Euclid, :Euclid)
1111

1212
##
1313

14+
## WARNING, THIS IS A DUPLICATE OF THE MACRO IN DFGVariable.jl TO MAKE SURE OVERLOADS ARE WORKING RIGHT
1415
macro defVariable(structname, manifold)
1516
return esc(quote
1617
Base.@__doc__ struct $structname <: InferenceVariable end
@@ -26,8 +27,8 @@ macro defVariable(structname, manifold)
2627
getDimension(::Type{M}) where {M <: $structname} = manifold_dimension(getManifold(M))
2728
getDimension(::M) where {M <: $structname} = manifold_dimension(getManifold(M))
2829
# FIXME legacy API to be deprecated
29-
getManifolds(::Type{M}) where {M <: $structname} = convert(Tuple, $manifold)
30-
getManifolds(::M) where {M <: $structname} = convert(Tuple, $manifold)
30+
# getManifolds(::Type{M}) where {M <: $structname} = convert(Tuple, $manifold)
31+
# getManifolds(::M) where {M <: $structname} = convert(Tuple, $manifold)
3132
end)
3233
end
3334

@@ -60,9 +61,9 @@ end
6061
@test getManifold( TestVariableType2) == Euclidean(2)
6162

6263
# legacy
63-
@test getManifolds(TestVariableType1) == (:Euclid,)
64+
# @test getManifolds(TestVariableType1) == (:Euclid,)
6465
@test getDimension(TestVariableType1) === 1
65-
@test getManifolds(TestVariableType2) == (:Euclid,:Euclid)
66+
# @test getManifolds(TestVariableType2) == (:Euclid,:Euclid)
6667
@test getDimension(TestVariableType2) === 2
6768

6869
##
@@ -72,9 +73,9 @@ end
7273
@test getManifold( TestVariableType2()) == Euclidean(2)
7374

7475
# legacy
75-
@test getManifolds(TestVariableType1()) == (:Euclid,)
76+
# @test getManifolds(TestVariableType1()) == (:Euclid,)
7677
@test getDimension(TestVariableType1()) === 1
77-
@test getManifolds(TestVariableType2()) == (:Euclid,:Euclid)
78+
# @test getManifolds(TestVariableType2()) == (:Euclid,:Euclid)
7879
@test getDimension(TestVariableType2()) === 2
7980

8081

0 commit comments

Comments
 (0)