Skip to content

Commit e98bc54

Browse files
committed
Deprecate lsfWho for lsf close #707
1 parent 8dc0d52 commit e98bc54

File tree

5 files changed

+12
-29
lines changed

5 files changed

+12
-29
lines changed

src/Deprecated.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
##=================================================================================
55
@deprecate getBlobEntry(var::AbstractDFGVariable, key::AbstractString) getBlobEntryFirst(var, Regex(key))
66

7+
@deprecate lsfWho(dfg::AbstractDFG, type::Symbol) lsf(dfg, getfield(Main, type))
8+
79
## ================================================================================
810
## Deprecated in v0.23
911
##=================================================================================

src/DistributedFactorGraphs.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ export isValidLabel
286286
## List
287287
export ls, lsf, ls2
288288
export lsTypes, lsfTypes, lsTypesDict, lsfTypesDict
289-
export lsWho, lsfWho
289+
export lsWho
290290
export isPrior, lsfPriors
291291
export hasTags, hasTagsNeighbors
292292

src/services/AbstractDFG.jl

Lines changed: 9 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -775,6 +775,15 @@ function ls(dfg::G, ::Type{T}) where {G <: AbstractDFG, T <: AbstractFactor}
775775
return map(x -> x.label, vxx)
776776
end
777777

778+
"""
779+
$(SIGNATURES)
780+
Lists the factors of a specific type in the factor graph.
781+
Example, list all the Point2Point2 factors in the factor graph `dfg`:
782+
lsfWho(dfg, :Point2Point2)
783+
784+
Notes
785+
- Return `Vector{Symbol}`
786+
"""
778787
function lsf(dfg::G, ::Type{T}) where {G <: AbstractDFG, T <: AbstractFactor}
779788
return ls(dfg, T)
780789
end
@@ -837,32 +846,6 @@ function lsWho(dfg::AbstractDFG, type::Symbol)
837846
return labels
838847
end
839848

840-
"""
841-
$(SIGNATURES)
842-
Gives back all factor labels that fit the bill:
843-
lsfWho(dfg, :Point2Point2)
844-
845-
Notes
846-
- Returns `Vector{Symbol}`
847-
848-
Dev Notes
849-
- Cloud versions will benefit from less data transfer
850-
- `ls(dfg::C, ::T) where {C <: CloudDFG, T <: ..}`
851-
852-
Related
853-
854-
ls, lsf, lsfPriors
855-
"""
856-
function lsfWho(dfg::AbstractDFG, type::Symbol)
857-
facs = getFactors(dfg)
858-
labels = Symbol[]
859-
for f in facs
860-
facType = typeof(getFactorType(f)) |> nameof
861-
facType == type && push!(labels, f.label)
862-
end
863-
return labels
864-
end
865-
866849
## list types
867850
##-----------
868851

test/iifInterfaceTests.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,6 @@ end
157157

158158
@test ls(dfg, LinearRelative) == [:abf1]
159159
@test lsf(dfg, LinearRelative) == [:abf1]
160-
@test lsfWho(dfg, :LinearRelative) == [:abf1]
161160

162161
@test getVariableType(v1) isa Position{1}
163162
@test getVariableType(dfg, :a) isa Position{1}

test/testBlocks.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1207,7 +1207,6 @@ function testGroup!(fg, v1, v2, f0, f1)
12071207

12081208
@test ls(fg, TestFunctorInferenceType1) == [:abf1]
12091209
@test lsf(fg, TestAbstractPrior) == [:af1]
1210-
@test lsfWho(fg, :TestFunctorInferenceType1) == [:abf1]
12111210

12121211
@test getVariableType(v1) == TestVariableType1()
12131212
@test getVariableType(fg, :a) == TestVariableType1()

0 commit comments

Comments
 (0)